home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / ckit210.zip / CKIT.DOC < prev    next >
Text File  |  1991-12-22  |  186KB  |  4,676 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                        C-KIT DOOR building Toolkit Library
  14.  
  15.                                   Version 2.10
  16.  
  17.  
  18.  
  19.                                 Reference Manual
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.                                  Distributed By
  30.  
  31.                          Data-Comp Information Systems
  32.                                  P.O. Box 5895
  33.                           Maryville, Tenn. 37802-5895
  34.  
  35.  
  36.               (615) 982-6537   (Hayes Ultra V.32, public line)
  37.               (615) 982-8723   (Hayes Ultra V.32, private line)
  38.               (615) 982-6512 (USR HST Dual Standard V.32, private line)
  39.               (615) 970-7418 (USR HST Dual Standard V.32, private line)
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                   Copyright (c) 1989, 90, 91 Rickie W. Belitz
  61.  
  62.  
  63.  
  64.  
  65.                                                               Introduction
  66.  
  67.                                    Introduction
  68.  
  69.        C-KIT Library is an extensive library of C runtime routines that
  70.        allow easy door program implementation using PCBoard 12.0 through
  71.        14.x, WILDCAT! systems, (all versions), GAP BBS, SPITFIRE BBS 3.0
  72.        and other systems using standard DOOR.SYS file along with RBBS-PC,
  73.        QuickBBS, Remote Access and other systems using DORINFOx.DEF files.
  74.        C-KIT 2.01 will also work properly with MikeBBS (MBBS) v9.9 and above.
  75.        CKIT will automatically work with the above system.  For systems
  76.        not listed above, CKIT can deal with them in one of two ways.
  77.        CKIT  can  utilize a file called GENERIC.SYS.    This is for
  78.        creating a system file for a system CKIT does not support. See
  79.        section on GENERIC.SYS for more information.  In addition,
  80.        CKIT will also accept a pointer to a structure that contains the
  81.        needed information for CKIT to operate.  This could be the result
  82.        of your program reading ANY BBS's system file. This structure will
  83.        allow C-KIT to work on ANY BBS system, providing the door author
  84.        reads the BBS file himself.
  85.  
  86.        Some other C-KIT Library's features include interrupt driven I/O,
  87.        16550AN UART support, FOSSIL support, provides information
  88.        available from the PCBoard .sys files, database files, multi-node
  89.        support (file sharing), multi-BBS support, local sysop function keys
  90.        and many more utilities are included for the door author.
  91.  
  92.        The C-KIT Library routines are written entirely in Assembly language
  93.        using SLR's Optasm.  The routines make use of C library functions
  94.        when possible and are compatible with Microsoft C,  Microsoft QuickC,
  95.        TURBO C, and TURBO C++.
  96.  
  97.        C-KIT Library supports the small, medium and large models.
  98.  
  99.  
  100.        Microsoft is a registered trademark, and QuickC is a trademark of
  101.        the Microsoft Corporation.
  102.  
  103.        TURBO C   is a registered trademark of Borland International Inc.
  104.  
  105.        TURBO C++ is a registered trademark of Borland International Inc.
  106.  
  107.        PCBoard   is a registered trademark of Clark Development Company.
  108.  
  109.        WILDCAT!  is a registered trademark of Mustang Software.
  110.  
  111.        SPITFIRE  is a registered trademark of Buffalo Creek Software
  112.  
  113.        RBBS-PC   is copyright (c) Tom Mack,  Capital PC Software Exchange
  114.  
  115.        QUICKBBS  is copyright (c) Adam Hudson
  116.  
  117.        REMOTE ACCESS is copyright (c) Andrew Milner, Continental Software
  118.  
  119.        MBBS is copyright (c) Mike Anderson
  120.  
  121.  
  122.                                                            Registration
  123.  
  124.        The unregistered library will display "Unregistered copy etc." as
  125.        part of the signoff message. The registered version eliminates this
  126.        signoff msg at the time the door is closed.  Please see the
  127.        registration information  below.  A lot of effort has gone into C-KIT,
  128.        to make sure it would operate reliably and with little effort
  129.        on the part of the door author.  If you find the program of use, please
  130.        register it and help support the Shareware method of program
  131.        distribution.   Registering will also help fund further development
  132.        of the libraries.
  133.  
  134.        C-KIT is being distributed as Shareware.
  135.  
  136.        The registration includes:
  137.  
  138.          ∙    A disk with the latest version of C-KIT, registered to you.
  139.  
  140.          .    Some small utility programs for easy door testing w/source.
  141.  
  142.          ∙    Self-Registration program for future releases of C-KIT
  143.  
  144.          ∙    Technical support via electronic mail
  145.  
  146.          .    A LARGE memory model of C-KIT.  (download from Data-Comp BBS)
  147.               (The LARGE model will also work as a HUGE model)
  148.  
  149.          .    Access to source code for reading other system files as they
  150.               become available.  All PCBoard source files are now available.
  151.  
  152.         For more information see the addresses, phone numbers listed
  153.         at the end of this document.
  154.  
  155.                                                           Global Variables
  156.  
  157.              Global Functions/Variable Naming Conventions
  158.  
  159.        The C-KIT Library defines a  number of variables and functions
  160.        in the c-kit header  file.  These have to be made public for
  161.        the linker to be able to resolve references to them.  Beginning
  162.        in C-KIT 2.0 ALL functions/variables available from the library
  163.        begin with the prefix "ck_".  This will help prevent any naming
  164.        conflicts with other globals in your source code.  Knowing that
  165.        all C-KIT's names begin with "ck_", you can prevent any collisions
  166.        with the public names contained in the library.  If this is of
  167.        little concern to you or if you do not like the names used in
  168.        the library because of this, then you can simply re-define
  169.        the names to any name you desire.  OLDCKIT.H does exactly this
  170.        for previous users of the library.  OLDCKIT.H re-defines the
  171.        new names to the old names used in the library.  If you included
  172.        OLDCKIT.H in your present source code, then the new library
  173.        names would work with no other changes to your present source code.
  174.  
  175.        Example:  Name desired   Library Name
  176.        =======  ===========     ============
  177.        #define  s_puts          ck_s_puts
  178.        #define  DUMP_USER       ck_DUMP_USER
  179.        #define  color           ck_color
  180.        #define  newline         ck_newline
  181.        #define  get_cmdline     ck_get_cmdline
  182.  
  183.        These would cause the compiler to reference the new name for all
  184.        references to old name.
  185.               do {
  186.                 color(green);
  187.                 s_puts("Command? ", NULL);
  188.                 get_cmdline();     /* read input into 'cmdline'  */
  189.                 newline();
  190.               } while( (DUMP_USER != TRUE) && ( strlen(cmdline) == 0 ));
  191.  
  192.  
  193.        See OLDCKIT.H and CKITDEMO.C, CKITDEMO.H.
  194.  
  195.        NOTE: The ONLY variable that does not have the "ck_" prefix is
  196.              the progname[]; array name in the CKIT.H file.
  197.  
  198.  
  199.                                                           Global Variables
  200.  
  201.                    Global Variables used by all BBS systems
  202.  
  203.        The C-KIT Library defines a  number of variables in the ckit.h
  204.        header  file.    Through  proper use,  these  variables  allow  the
  205.        programmer  to customize  the C-KIT  Library  functions to  meet
  206.        particular application program's needs.
  207.  
  208.        ck_DUMP_USER
  209.        -------------------------------------------------------------------
  210.        Defined As:    short ck_DUMP_USER;
  211.  
  212.        Description:   This variable will be set if the user hangs up,
  213.                       his/her time runs out, carrier is lost, or if the
  214.                       sysop wants to return the user to the BBS system using
  215.                       function key F8.  You should check this flag in all
  216.                       major loops in the door program.
  217.  
  218.  
  219.        ck_FORCEOFFHOOK
  220.        -------------------------------------------------------------------
  221.        Defined As:    short ck_FORCEOFFHOOK
  222.  
  223.        Description:   This variable should be set to TRUE or FALSE in the
  224.                       CKIT.H file.  If this variable is TRUE, the modem
  225.                       will be placed OFF-HOOK if carrier is dropped in the
  226.                       door before returning to the system.  If FORCEOFFHOOK
  227.                       is false, the door will not take the modem off-hook.
  228.                       See CKIT.H
  229.  
  230.        ck_USERFILE
  231.        -------------------------------------------------------------------
  232.        Defined As:    short ck_USERSFILE
  233.  
  234.        Description:   This variable should be set to TRUE or FALSE in the
  235.                       CKIT.H file.  If this variable is TRUE, C-KIT will
  236.                       open the Users file and those variables will be
  237.                       available.  If not, only the PCBOARD.SYS file will be
  238.                       opened and the user information will not be available.
  239.                       See CKIT.H.
  240.  
  241.        ck_option
  242.        ------------------------------------------------------------------
  243.        Defined As:    unsigned char ck_option;
  244.  
  245.        Description:   This variable is set to indicate how the user was
  246.                       logged off the system.  There are 5 macro's in the
  247.                       CKIT header file that describes each.
  248.  
  249.                         #define     EXITDOOR    0  Normal door exit
  250.                         #define     NOCARRIER   1  Dropped carrier*
  251.                         #define     TIMEOUT     2  Keyboard timeout*
  252.                         #define     SYSOP_O     3  Sysop request*
  253.                         #define     SYSTEMTIME  4  System time expired*
  254.                         #define     LOGOFF      5  User logged off
  255.  
  256.                        * These are normally handled internally by C-KIT
  257.  
  258.                                           COMPATIBILITY   Global Variables
  259.  
  260.        ck_silent               pcboard.sys door.sys wildcat! dorinfox.def
  261.        ------------------------------------------------------------------
  262.        Defined As:    short ck_silent;
  263.  
  264.        Description:   This variable when TRUE will prevent keyboard timeout
  265.                       beeps from being sent to the local console.
  266.                       It can be controlled via your program.
  267.  
  268.        ck_NO_FKEYS             pcboard.sys door.sys wildcat! dorinfox.def
  269.        ------------------------------------------------------------------
  270.        Defined As:    short ck_NO_FKEYS;
  271.  
  272.        Description:   This variable when TRUE will disable the local
  273.                       sysop keyboard F-keys and ALT keys except for
  274.                       ALT-H.  Default is FALSE. (F-keys enabled)
  275.  
  276.        ck_NOSYSTEM             pcboard.sys door.sys wildcat! dorinfox.def
  277.        ------------------------------------------------------------------
  278.        Defined As:    short ck_NOSYSTEM;
  279.  
  280.        Description:   This variable when TRUE will tell open_door()
  281.                       to not attempt a file open but to read it's
  282.                       information from a data structure.  Used for
  283.                       supporting BBS's not supported by C-kit.
  284.                       See open_door() for details.
  285.  
  286.        ck_logoff_color         pcboard.sys door.sys wildcat! dorinfox.def
  287.        ------------------------------------------------------------------
  288.        Defined As:    short ck_logoff_color;
  289.  
  290.        Description:   This variable used to specifiy the color of the
  291.                       exit_msg[] string. (See below).
  292.                       See the ckit.h file for colors available.
  293.  
  294.         Example:      ck_logoff_color = (green).
  295.  
  296.         NOTE:         If not specified, the default color is violet.
  297.  
  298.  
  299.  
  300.        ck_exit_msg             pcboard.sys door.sys wildcat! dorinfox.def
  301.        ------------------------------------------------------------------
  302.        Defined As:    char  ck_exit_msg[40];
  303.  
  304.        Description:   THIS VARIABLE IS NO LONGER AVAILABLE IN CKIT2.0
  305.                       PLEASE SEE **ck_logoff_msgs.
  306.  
  307.  
  308.        ck_logoff_msg           pcboard.sys door.sys wildcat! dorinfox.def
  309.        ------------------------------------------------------------------
  310.        Defined As:    char  ck_logoff_msg[40];
  311.  
  312.        Description:   THIS VARIABLE IS NO LONGER AVAILABLE IN CKIT2.0
  313.                       PLEASE SEE **ck_logoff_msgs.
  314.  
  315.                                           COMPATIBILITY   Global Variables
  316.  
  317.        ck_display                         pcboard.sys
  318.        ------------------------------------------------------------------
  319.        Defined As:    short ck_display;
  320.  
  321.        Description:   This variable is set to indicate the status of the
  322.                       local BBS display.
  323.                       file.  TRUE/FALSE   0 = No,  1 = yes.
  324.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  325.  
  326.        ck_printer                         pcboard.sys
  327.        ------------------------------------------------------------------
  328.        Defined As:    short ck_printer;
  329.  
  330.        Description:   This variable is set to indicate the status of the
  331.                       BBS printer.
  332.                       TRUE/FALSE   0 = No,  1 = yes.
  333.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  334.  
  335.        ck_pagebell                        pcboard.sys
  336.        ------------------------------------------------------------------
  337.        Defined As:    short ck_pagebell;
  338.  
  339.        Description:   This variable is set to indicate the status of the
  340.                       BBS pagebell.
  341.                       TRUE/FALSE   0 = No,  1 = yes.
  342.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  343.  
  344.        ck_callalarm                       pcboard.sys
  345.        ------------------------------------------------------------------
  346.        Defined As:    short ck_callalarm;
  347.  
  348.        Description:   This variable is set to indicate the status of the
  349.                       BBS  caller alarm.
  350.                       TRUE/FALSE   0 = No,  1 = yes.
  351.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  352.  
  353.        ck_PCB                   door.sys pcboard.sys wildcat! dorinfx.def
  354.        ------------------------------------------------------------------
  355.        Defined As:    short ck_PCB;
  356.  
  357.        Description:   This variable is set to indicate whether C-KIT found
  358.                       a PCBoard.sys file.
  359.                       TRUE/FALSE   0 = No,  1 = yes.
  360.  
  361.        ck_GAP                   door.sys pcboard.sys wildcat! dorinfx.def
  362.        ------------------------------------------------------------------
  363.        Defined As:    short ck_GAP;
  364.  
  365.        Description:   This variable is set to indicate whether C-KIT found
  366.                       a door.sys file.
  367.                       TRUE/FALSE   0 = No,  1 = yes.
  368.  
  369.        ck_PCB12                 door.sys pcboard.sys wildcat! dorinfx.def
  370.        ------------------------------------------------------------------
  371.        Defined As:    short ck_PCB12;
  372.  
  373.        Description:   This variable is set to indicate whether C-KIT found
  374.                       a PCBoard version 12.0 pcboard.sys file or not.
  375.                       TRUE/FALSE   0 = No,  1 = yes.
  376.                                            COMPATIBILITY   Global Variables
  377.  
  378.        ck_WILDCAT               door.sys pcboard.sys wildcat! dorinfx.def
  379.        ------------------------------------------------------------------
  380.        Defined As:    short ck_WILDCAT;
  381.  
  382.        Description:   This variable is set to indicate whether C-KIT found
  383.                       a WILDCAT callinfo.bbs file or not.
  384.                       TRUE/FALSE   0 = No,  1 = yes.
  385.  
  386.        ck_RBBS                  door.sys pcboard.sys wildcat! dorinfx.def
  387.        ------------------------------------------------------------------
  388.        Defined As:    short ck_RBBS;
  389.  
  390.        Description:   This variable is set to indicate whether C-KIT found
  391.                       a RBBS type DORINFOx.DEF file or not.
  392.                       TRUE/FALSE   0 = No,  1 = yes.
  393.  
  394.        ck_GENERIC                                    any BBS system
  395.        ------------------------------------------------------------------
  396.        Defined As:    short ck_GENERIC;
  397.  
  398.        Description:   This variable is set to indicate whether C-KIT found
  399.                       a GENERIC.SYS file.
  400.                       TRUE/FALSE   0 = No,  1 = yes.
  401.  
  402.         If ck_GENERIC is TRUE you, the door author,  should stop and
  403.         ask the user for his/herfirst and last name.
  404.         C-kit no longer does this for you.
  405.           if(GENERIC) {
  406.             sprintf("\nPlease enter first and last name (MAX 25) ->");
  407.             get_cmdline_raw(45);
  408.             strncpy(ck_fullname, cmdline, 25);
  409.         }
  410.  
  411.        ck_graphics             pcboard.sys door.sys wildcat! dorinfox.def
  412.        ------------------------------------------------------------------
  413.        Defined As:    short ck_graphics;
  414.  
  415.        Description:   This variable is set to indicate the status of the
  416.                       user graphics mode.
  417.                       Supports ANSI X3.64 standard commands.
  418.                       TRUE/FALSE   0 = No,  1 = yes.
  419.  
  420.        ck_non_ibm              pcboard.sys door.sys wildcat! dorinfox.def
  421.        ------------------------------------------------------------------
  422.        Defined As:    short ck_non_ibm;
  423.  
  424.        Description:   This variable is set to indicate whether the caller
  425.                       is using 7 bits instead of 8 bits.  Using 7 bits
  426.                       doesn't allow for IBM graphic characters above
  427.                       128 to be displayed correctly.
  428.                       TRUE/FALSE   0 = No,  1 = yes.
  429.  
  430.        ck_error_connection          pcboard.sys door.sys wildcat!
  431.        ------------------------------------------------------------------
  432.        Defined As:    short ck_error_connection;
  433.  
  434.        Description:   This variable is set to indicate the status of the
  435.                       modem error_connection.
  436.                       TRUE/FALSE   0 = No,  1 = yes.
  437.  
  438.                                           COMPATIBILITY   Global Variables
  439.  
  440.        ck_local                pcboard.sys door.sys wildcat! dorinfox.def
  441.        ------------------------------------------------------------------
  442.        Defined As:    short ck_local;
  443.  
  444.        Description:   This variable is set to indicate the status of the
  445.                       local/remote operation of door.
  446.                       TRUE/FALSE   0 = No,  1 = yes.
  447.  
  448.        ck_expert                          pcboard.sys door.sys
  449.        ------------------------------------------------------------------
  450.        Defined As:    short ck_expert;
  451.  
  452.        Description:   This variable is set to indicate the status of the
  453.                       expert/novice mode of user.
  454.                       TRUE/FALSE   0 = No,  1 = yes.
  455.  
  456.        ck_event_active                    pcboard.sys
  457.        ------------------------------------------------------------------
  458.        Defined As:    short ck_event_active;
  459.  
  460.        Description:   This variable is set to indicate the status of the
  461.                       system event.
  462.                       TRUE/FALSE   0 = No,  1 = yes.
  463.                       Useful with  14.x pcboard.sys usage only
  464.  
  465.        ck_event_slide                     pcboard.sys
  466.        ------------------------------------------------------------------
  467.        Defined As:    short ck_event_slide;
  468.  
  469.        Description:   This variable is set to indicate whether the system
  470.                       event can be moved or not.
  471.                       TRUE/FALSE   0 = No,  1 = yes.
  472.                       Useful with 14.x pcboard.sys useage only
  473.  
  474.        ck_sysop_next                      pcboard.sys
  475.        ------------------------------------------------------------------
  476.        Defined As:    char  ck_sysop_next[2];
  477.  
  478.        Description:   This C string indicates the status of the
  479.                       Sysop Next flag.  N = sysop next, X = exit to system,
  480.                       space = nothing pending.
  481.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  482.  
  483.        ck_netchat                         pcboard.sys
  484.        ------------------------------------------------------------------
  485.        Defined As:    char  ck_netchat[2];
  486.  
  487.        Description:   This C string indicates the status of the
  488.                       the user's netchat.  U = Unavailable,
  489.                       A = available.
  490.                       Useful with 12.0 - > 14.x pcboard.sys usage only
  491.  
  492.        ck_mem_msg                         pcboard.sys 14.5
  493.        ------------------------------------------------------------------
  494.        Defined As:    long  ck_mem_msg;
  495.  
  496.        Description:   Memorized message pointer.  This is in it's raw
  497.                       form.  To use it, you will need to convert from
  498.                       QBasic single (MKS$) to IEEE long.   Conversion
  499.                       routines are available on the support BBS.
  500.  
  501.                                          COMPATIBILITY   Global Variables
  502.  
  503.        ck_aport                pcboard.sys door.sys wildcat! dorinfox.def
  504.        ------------------------------------------------------------------
  505.        Defined As:    char  ck_aport[2];
  506.  
  507.        Description:   This C string is an ASCII string of the com
  508.                        port in use as determined.
  509.                        See also port.
  510.  
  511.        ck_bps_open                  pcboard.sys door.sys wildcat!
  512.        ------------------------------------------------------------------
  513.        Defined As:    char  ck_bps_open[6];
  514.  
  515.        Description:   This C string is an ASCII string of the
  516.                       BBS's DTE to modem baud rate.
  517.                       Not available with PCBoard 12.0
  518.  
  519.        ck_baud_rate            pcboard.sys door.sys wildcat! dorinfox.def
  520.        ------------------------------------------------------------------
  521.        Defined As:    char  ck_baud_rate[6];
  522.  
  523.        Description:   This C string is an ASCII string of the
  524.                       callers baud rate. (DCE rate)
  525.  
  526.        ck_uart_base            pcboard.sys door.sys wildcat! dorinfox.def
  527.        ------------------------------------------------------------------
  528.        Defined As:    short ck_uart_base;
  529.  
  530.        Description:   This contains the UART's base address that C-KIT is
  531.                       currently using either as the default or passed
  532.                       by the PORT command.
  533.  
  534.        ck_irq                  pcboard.sys door.sys wildcat! dorinfox.def
  535.        ------------------------------------------------------------------
  536.        Defined As:    short ck_irq;
  537.  
  538.        Description:   This contains the IRQ that C-KIT is
  539.                       currently using either as the default or
  540.                       passed by the PORT command.
  541.  
  542.        ck_firstname            pcboard.sys door.sys wildcat! dorinfox.def
  543.        ------------------------------------------------------------------
  544.        Defined As:    char  ck_firstname[16];
  545.  
  546.        Description:   This C string is an ASCII string of the
  547.                       caller first name.
  548.  
  549.        ck_password                  pcboard.sys door.sys wildcat!
  550.        ------------------------------------------------------------------
  551.        Defined As:    char  ck_password[13];
  552.  
  553.        Description:   This C string is an ASCII string of the
  554.                       caller password.
  555.  
  556.        ck_fullname             pcboard.sys door.sys wildcat! dorinfox.def
  557.        ------------------------------------------------------------------
  558.        defined As:    char  ck_fullname[26];
  559.  
  560.        Description:   This C string is an ASCII string of the
  561.                       caller fullname.
  562.  
  563.                                           COMPATIBILITY   Global Variables
  564.  
  565.        ck_page_length          pcboard.sys door.sys wildcat! dorinfox.def
  566.        ------------------------------------------------------------------
  567.        Defined As:    BYTE  ck_page_length;
  568.  
  569.        Description:   Page length of user.  This information is not
  570.                       available with PCBoard 12.0 so there is a default
  571.                       of 23.  The door author can adjust as desired.
  572.                       This is also used by display_file().  Setting to
  573.                       0 equals continous. (NON-STOP).
  574.  
  575.        ck_language                        pcboard.sys
  576.        ------------------------------------------------------------------
  577.        defined As:    char  ck_language[5];
  578.  
  579.        Description:   This C string is an ASCII string of the
  580.                       caller language.
  581.                       Space = English
  582.  
  583.  
  584.        ck_time_logged               pcboard.sys door.sys wildcat!
  585.        ------------------------------------------------------------------
  586.        defined As:    char  ck_time_logged[6];
  587.  
  588.        Description:   This C string is an ASCII string of the time
  589.                       caller logged onto the BBS.
  590.  
  591.        ck_event_time                      pcboard.sys door.sys
  592.        ------------------------------------------------------------------
  593.        defined As:    char  ck_event_time[6];
  594.  
  595.        Description:   This C string is an ASCII string of the
  596.                       system event time of the BBS as HH:MM.
  597.                       Not available with PCBoard 12.0
  598.  
  599.        ck_time_on                         pcboard.sys
  600.        ------------------------------------------------------------------
  601.        Defined As:    short ck_time_on;
  602.  
  603.        Description:   This variable indicates the time in minutes
  604.                       past midnight the user logged on.
  605.  
  606.        ck_prev_used                       pcboard.sys
  607.        ------------------------------------------------------------------
  608.        Defined As:    short ck_prev_used;      NOTE: N/A for PCBoard 12.0
  609.  
  610.        Description:   This variable indicates the time in minutes
  611.                       used in previous calls today.
  612.  
  613.        ck_user_record               pcboard.sys door.sys wildcat!
  614.        ------------------------------------------------------------------
  615.        Defined As:    unsigned ck_short user_record;
  616.  
  617.        Description:   This variable holds the user record number.
  618.  
  619.        ck_dload_limit                     pcboard.sys
  620.        ------------------------------------------------------------------
  621.        Defined As:    short     ck_dload_limit;
  622.  
  623.        Description:   This variable holds the user's allowed dload Kbytes
  624.                       on the system.
  625.  
  626.                                           COMPATIBILITY   Global Variables
  627.  
  628.        ck_time_limit                      pcboard.sys
  629.        ------------------------------------------------------------------
  630.        Defined As:    short     ck_time_limit;
  631.  
  632.        Description:   This variable holds the user BBS system time limit
  633.                       in minutes.
  634.  
  635.        ck_time_credit                     pcboard.sys
  636.        ------------------------------------------------------------------
  637.        Defined As:    short     ck_time_credit;
  638.  
  639.        Description:   This variable holds the time the user has been given
  640.                       (pos or neg.) that will be added to pcboard.sys when
  641.                       returned to the bulletin board.
  642.  
  643.        ck_time_credit_old                 pcboard.sys
  644.        ------------------------------------------------------------------
  645.        Defined As:    short     ck_time_credit_old;
  646.  
  647.        Description:   This variable holds the time credit in minutes
  648.                       (pos or neg.) that was originally found in the
  649.                       pcboard.sys when the door was opened.  This will
  650.                       be added with the time_credit when the door is
  651.                       closed.
  652.  
  653.        ck_time_added                    pcboard.sys
  654.        ------------------------------------------------------------------
  655.        Defined As:    short     ck_time_added;
  656.  
  657.        Description:   This variable holds the area user time added so
  658.                       far in minutes.
  659.  
  660.        ck_min_left             pcboard.sys door.sys wildcat! dorinfox.def
  661.        ------------------------------------------------------------------
  662.        Defined As:    short     ck_min_left;
  663.  
  664.        Description:   This variable holds the user time left on system
  665.                       at the time the door was opened. (static).
  666.                       If you want the time remaining in the door, you
  667.                       would need to call the mins_left_system() procedure.
  668.  
  669.        ck_min_remaining                                          door.sys
  670.        ------------------------------------------------------------------
  671.        Defined As:    char      ck_min_remaining[6];
  672.  
  673.        Description:   This is the same thing as min_left.  It is
  674.                       available as a string only if door.sys is used.
  675.                       See min_left above.
  676.  
  677.        ck_sec_remaining                                          door.sys
  678.        ------------------------------------------------------------------
  679.        Defined As:    char      ck_sec_remaining[6];
  680.  
  681.        Description:   This variable holds the seconds left on system
  682.                       at the time the door was opened. (static).
  683.                       If you want the time remaining in the door, you
  684.                       would need to call the mins_left_system() procedure.
  685.  
  686.                                           COMPATIBILITY   Global Variables
  687.  
  688.        ck_port                      pcboard.sys door.sys wildcat!
  689.        ------------------------------------------------------------------
  690.        Defined As:    short     ck_port;
  691.  
  692.        Description:   This variable holds the com port in use.
  693.                       Equal to 0 if local mode.
  694.  
  695.        ck_node[]               pcboard.sys door.sys wildcat! dorinfox.def
  696.        ------------------------------------------------------------------
  697.        Defined As:    char      ck_node[3];    NOTE: N/A for PCBoard 12.0
  698.  
  699.        Description:   This string holds the node in use.
  700.                       Equal to space if no network active.
  701.  
  702.  
  703.        *ck_conferences                  door.sys        wildcat!
  704.        ------------------------------------------------------------------
  705.        Defined As:    char *ck_conferences;
  706.  
  707.        Description:   This a pointer to a string of conferences/forums
  708.                       the user is registered in.
  709.  
  710.        ck_parity                        door.sys wildcat!
  711.        ------------------------------------------------------------------
  712.        Defined As:    short ck_parity;
  713.  
  714.        Description:   Represent the ASCII character of parity in use.
  715.                       Note this NOT a string. It will either be ASCII
  716.                       7 (0x37) or 8 (0x38).
  717.  
  718.        ck_protocol                  pcboard.sys door.sys wildcat!
  719.        ------------------------------------------------------------------
  720.        Defined As:    char ck_protocol[15]
  721.  
  722.        Description:   String containing the users current protocol setting.
  723.                       PCBoard/GAP/SPITFIRE will only list the 1st char. of the
  724.                       protocol, WILDCAT! will give the entire protocol
  725.                       name.
  726.  
  727.        ck_security_level                   door.sys wildcat! dorinfox.def
  728.        ------------------------------------------------------------------
  729.        Defined As:    char ck_security_level[5]
  730.  
  731.        Description:   String containing the users security level.
  732.                       See also ck_user.sec below
  733.  
  734.        ck_current_conf                  door.sys
  735.        ------------------------------------------------------------------
  736.        Defined As:    short ck_current_conf;
  737.  
  738.        Description:   Conference number user just exited from to door.
  739.  
  740.        ck_caller_bday                   door.sys wildcat!
  741.        ------------------------------------------------------------------
  742.        Defined As:    char ck_caller_bday[8];
  743.  
  744.        Description:   String containing the callers birthday.
  745.                       as MM/DD/YY.  Not available with PCBoard systems.
  746.  
  747.                                           COMPATIBILITY   Global Variables
  748.  
  749.        ck_main_dir                      door.sys
  750.        ------------------------------------------------------------------
  751.        Defined As:    char ck_main_dir[80];
  752.  
  753.        Description:   String containing the path to the MAIN directory
  754.                       wherever the users file is located.
  755.  
  756.        ck_gen_dir                       door.sys
  757.        ------------------------------------------------------------------
  758.        Defined As:    char ck_gen_dir[80];
  759.  
  760.        Description:   String containing the path to the GEN directory.
  761.  
  762.  
  763.        ck_sysop_name                    door.sys dorinfox.def
  764.        ------------------------------------------------------------------
  765.        Defined As:    char ck_sysop_name[15];
  766.  
  767.        Description:   String containing the sysop's first name.
  768.  
  769.        ck_sysop_alias                   door.sys
  770.        ------------------------------------------------------------------
  771.        Defined As:    char ck_sysop_alias[15];
  772.  
  773.        Description:   String containing the sysop's alias name.
  774.  
  775.        ck_ansi_ng                       door.sys
  776.        ------------------------------------------------------------------
  777.        Defined As:    short ck_ansi_ng;
  778.  
  779.        Description:   ANSI supported and caller using NG mode.
  780.                       TRUE/FALSE   0 = No,  1 = yes.
  781.  
  782.        ck_record_lock                   door.sys
  783.        ------------------------------------------------------------------
  784.        Defined As:    short ck_record_lock;
  785.  
  786.        Description:   User record locking.
  787.                       TRUE/FALSE   0 = No,  1 = yes.
  788.  
  789.        ck_default_color                 door.sys
  790.        ------------------------------------------------------------------
  791.        Defined As:    char ck_default_color[2];
  792.  
  793.        Description:   String containing system's default color
  794.  
  795.        ck_last_called                   door.sys
  796.        ------------------------------------------------------------------
  797.        Defined As:    char ck_last_called[6];
  798.  
  799.        Description:   String containing user time date called.
  800.                       HH:MM.
  801.  
  802.        ck_last_file_scan                door.sys wildcat!
  803.        ------------------------------------------------------------------
  804.        Defined As:    char ck_last_file_scan[9];
  805.  
  806.        Description:   String containing user last new files scan as
  807.                       MM/DD/YY.
  808.  
  809.                                           COMPATIBILITY   Global Variables
  810.  
  811.        ck_daily_files                   door.sys wildcat!
  812.        ------------------------------------------------------------------
  813.        Defined As:    char ck_daily_files[4];
  814.  
  815.        Description:   String containing number of files user has download
  816.                       so far today.
  817.  
  818.        ck_daily_bytes                   door.sys wildcat!
  819.        ------------------------------------------------------------------
  820.        Defined As:    char ck_daily_bytes[4];
  821.  
  822.        Description:   String containing number of K bytes user downloaded
  823.                       so far today.
  824.  
  825.        ck_total_doors                   door.sys
  826.        ------------------------------------------------------------------
  827.        Defined As:    char ck_total_doors[4];
  828.  
  829.        Description:   String containing number of doors user has opened.
  830.  
  831.        ck_msgs_left                     door.sys
  832.        ------------------------------------------------------------------
  833.        Defined As:    char ck_msgs_left[4];
  834.  
  835.        Description:   String containing total number of messages left by
  836.                       user.
  837.  
  838.        ck_max_files                       door.sys
  839.        ------------------------------------------------------------------
  840.        Defined As:    char ck_max_files[4];
  841.  
  842.        Description:   String containing Max. number of files allowed.
  843.  
  844.        ck_upload_Kbytes                   door.sys
  845.        ------------------------------------------------------------------
  846.        Defined As:    char ck_upload_Kbyte[10];
  847.  
  848.        Description:   String containing total "K" bytes uploaded.
  849.  
  850.        ck_download_Kbytes                   door.sys wildcat!
  851.        ------------------------------------------------------------------
  852.        Defined As:    char ck_download_Kbyte[10];
  853.  
  854.        Description:   String containing total "K" bytes downloaded.
  855.  
  856.        ck_dload_total                        door.sys wildcat!
  857.        ------------------------------------------------------------------
  858.        Defined As:    char ck_dload_total[5];
  859.  
  860.        Description:   String containing total files downloaded.
  861.  
  862.        ck_upload_total                      door.sys wildcat!
  863.        ------------------------------------------------------------------
  864.        Defined As:    char ck_upload_total[5];
  865.  
  866.        Description:   String containing total files uploaded.
  867.  
  868.                                           COMPATIBILITY   Global Variables
  869.  
  870.        ck_monitor_type                               wildcat!
  871.        ------------------------------------------------------------------
  872.        Defined As:    char ck_monitor_type[5];
  873.  
  874.        Description:   String containing monitor type MONO/COLOR
  875.                       NOTE: C-KIT will set graphics true/false
  876.                       depending on this setting. see Graphics above.
  877.  
  878.        ck_max_sec                                    wildcat!
  879.        ------------------------------------------------------------------
  880.        Defined As:    char ck_max_sec[5];
  881.  
  882.        Description:   String containing a systems maximum user
  883.                       security level for WILDCAT! systems.
  884.  
  885.  
  886.        ck_high_msg                                   wildcat!
  887.        ------------------------------------------------------------------
  888.        Defined As:    char ck_high_msg[10]
  889.  
  890.        Description:   String containing the users highest message
  891.                       read.
  892.  
  893.        ck_name_in_use                                wildcat!
  894.        ------------------------------------------------------------------
  895.        Defined As:    BYTE ck_name_in_use
  896.  
  897.        Description:   Set to TRUE/FALSE. This is called already_connected
  898.                        in the WILDCAT def. file.
  899.        ck_door_opened                                wildcat!
  900.        ------------------------------------------------------------------
  901.        Defined As:    short ck_door_opened
  902.  
  903.        Description:   Which door was opened to run your door.
  904.  
  905.        ck_BBSname                                    dorinfox.def
  906.        ------------------------------------------------------------------
  907.        Defined As:    char ck_BBSname[63];
  908.  
  909.        Description:   Name of the BBS system running the door.
  910.  
  911.        ck_pcbsysbuf                                  pcboard.sys
  912.        ------------------------------------------------------------------
  913.        Defined As:    BYTE    *ck_pcbsysbuf;
  914.  
  915.        Description:   This is a pointer to the buffer holding the
  916.                       pcboard.sys file read.  This buffer will be
  917.                       written back to pcboard.sys when close_door()
  918.                       is called.  It is provided so a door author
  919.                       can manipulate any byte in the pcboard.sys
  920.                       file and will in turn be written back to the
  921.                       pcboard.sys file.
  922.  
  923.                                                           Global Variables
  924.  
  925.        These are part of the structure "ck_user" as defined in the CKIT.H file.
  926.        All these user structure members are available only if the door author
  927.        specifies USERFILES True (see above) and the system is PCBoard version
  928.        14.x.  Some but not all members are available if the author specifies
  929.        USERFILE True and used with Pcboard version 12.0.  If the door author
  930.        does not specify USERFILE's file TRUE, then do not use this structure.
  931.  
  932.        If you plan on using this structure and/or update_user(), you
  933.        must using WORD alignment when compiling your door program for
  934.        CKIT < version 2.0.  For CKIT versions 2.0 and greater, you must
  935.        use BYTE alignment.
  936.  
  937.        ck_user.name   See also fullname
  938.        ------------------------------------------------------------------
  939.        Defined As:    char    ck_user.name[26];
  940.  
  941.        Description:   This C string is an ASCII string of the
  942.                       caller's fullname.
  943.  
  944.        ck_user.city
  945.        ------------------------------------------------------------------
  946.        Defined As:    char    ck_user.city[25];
  947.  
  948.        Description:   This C string is an ASCII string of the
  949.                       caller's city, state.
  950.  
  951.        ck_user.pwrd
  952.        ------------------------------------------------------------------
  953.        Defined As:    char    ck_user.pwrd[13];
  954.  
  955.        Description:   This C string is an ASCII string of the
  956.                       caller's password.
  957.  
  958.        ck_user.bphone
  959.        ------------------------------------------------------------------
  960.        Defined As:    char    ck_user.bphone[14];
  961.  
  962.        Description:   This C string is an ASCII string of the caller's
  963.                       business phone number.
  964.  
  965.        ck_user.phone
  966.        ------------------------------------------------------------------
  967.        Defined As:    char    ck_user.phone[14];
  968.  
  969.        Description:   This C string is an ASCII string of the caller's
  970.                       home phone number.
  971.  
  972.        ck_user.last_date
  973.        ------------------------------------------------------------------
  974.        Defined As:    char    ck_user.last_date[7];
  975.  
  976.        Description:   This C string is an ASCII string of the caller's
  977.                       last date on system.
  978.                       Format is YYMMDD
  979.  
  980.  
  981.                                                           Global Variables
  982.  
  983.         These are part of the structure "ck_user" as defined in the
  984.         CKIT.H file.  Information available from user file.
  985.  
  986.        ck_user.last_time
  987.        ------------------------------------------------------------------
  988.        Defined As:    char    ck_user.last_time[6];
  989.        Description:   This C string is an ASCII string of the caller's
  990.                       last time on system.
  991.                       Format is HH:MM
  992.  
  993.        ck_user.expert     See also expert above
  994.        ------------------------------------------------------------------
  995.        Defined As:    char    user.expert[2];
  996.  
  997.        Description:   This C string is an ASCII string of the caller
  998.                       expert mode ( Y or N )
  999.  
  1000.        ck_user.protocol
  1001.        ------------------------------------------------------------------
  1002.        Defined As:    char    ck_user.protocol[2];
  1003.  
  1004.        Description:   This C string is an ASCII string of the caller
  1005.                       protocol type in effect.
  1006.  
  1007.        ck_user.packed_byte
  1008.        ------------------------------------------------------------------
  1009.        Defined As:    BYTE    ck_user.packed_byte;
  1010.  
  1011.        Description:   This holds the PCBoard packed byte to indicate
  1012.                       various user options in the user file.
  1013.  
  1014.        ck_user.filedate                         see also _last_file_scan
  1015.        ------------------------------------------------------------------
  1016.        Defined As:    char    ck_user.filedate[7];
  1017.  
  1018.        Description:   This C string is an ASCII string of the caller
  1019.                       last DIR scan. in YYMMDD format
  1020.  
  1021.        ck_user.security
  1022.        ------------------------------------------------------------------
  1023.        Defined As:    BYTE   ck_user.security;
  1024.  
  1025.        Description:   This variable holds the user security level as
  1026.                       determined from USER file.
  1027.  
  1028.        ck_user.total_calls
  1029.        ------------------------------------------------------------------
  1030.        Defined As:    short     ck_user.total_calls;
  1031.  
  1032.        Description:   This variable holds the user total calls on system.
  1033.  
  1034.        ck_user.page_length        see also page_length
  1035.        ------------------------------------------------------------------
  1036.        Defined As:    BYTE      ck_user.page_length;
  1037.  
  1038.        Description:   This variable holds the user page setting.
  1039.  
  1040.        ck_user.uploads             see also upload_total
  1041.        ------------------------------------------------------------------
  1042.        Defined As:    short     ck_user.uploads;
  1043.        Description:   This variable holds the user total uploads.
  1044.  
  1045.                                                           Global Variables
  1046.  
  1047.         These are part of the structure "ck_user" as defined in the
  1048.         CKIT.H file.  Information available from user file.
  1049.  
  1050.        ck_user.dloads               see also dload_total
  1051.        ------------------------------------------------------------------
  1052.        Defined As:    short     ck_user.dloads;
  1053.  
  1054.        Description:   This variable holds the user total downloads.
  1055.  
  1056.        ck_user.dload_bytes          see also dload_total
  1057.        ------------------------------------------------------------------
  1058.        Defined As:    double    ck_user.dload_bytes;
  1059.  
  1060.        Description:   This variable holds the user total DAILY
  1061.                       downloaded bytes determined from USER file.
  1062.                       This variable is in it's raw Qbasic MKD$.
  1063.                       To be of use to C, it needs to be converted
  1064.                       from QBASIC real to C's IEEE float.
  1065.                       The conversion routines/examples are available from
  1066.                       the support BBS. Before changing this variable
  1067.                       it should also be converted back to a QBASIC real.
  1068.  
  1069.        ck_user.comment1
  1070.        ------------------------------------------------------------------
  1071.        Defined As:    char    ck_user.comment1[31];
  1072.  
  1073.        Description:   This C string is an ASCII string of the caller
  1074.                       user maintained comment.
  1075.  
  1076.        ck_user.comment2
  1077.        ------------------------------------------------------------------
  1078.        Defined As:    char    ck_user.comment2[32];
  1079.  
  1080.        Description:   This C string is an ASCII string of the caller
  1081.                       sysop maintained comment.
  1082.  
  1083.        ck_user.time_used
  1084.        ------------------------------------------------------------------
  1085.        Defined As:    short   ck_user.time_used;
  1086.  
  1087.        Description:   Elapsed time on system. (minutes)
  1088.  
  1089.        ck_user.expire_date
  1090.        ------------------------------------------------------------------
  1091.        Defined As:    char    ck_user.expire_date[7];
  1092.  
  1093.        Description:   This C string is an ASCII string of the caller
  1094.                       expiration date in YYMMDD format.
  1095.  
  1096.        ck_user.expire_level
  1097.        ------------------------------------------------------------------
  1098.        Defined As:    BYTE    ck_user.expire_level;
  1099.  
  1100.        Description:   This is the users expired security level read
  1101.                       from pcboard users file.
  1102.  
  1103.                                                           Global Variables
  1104.  
  1105.         These are part of the structure "ck_user" as defined in the
  1106.         CKIT.H file.  Information available from user file.
  1107.  
  1108.        ck_user.current_conf
  1109.        ------------------------------------------------------------------
  1110.        Defined As:    BYTE    ck_user.current_conf;
  1111.  
  1112.        Description:   This is the last conference user was in read
  1113.                       from pcboard users file.
  1114.  
  1115.        ck_user.conferences
  1116.        ------------------------------------------------------------------
  1117.        Defined As:    BYTE    ck_user.conferences[6]
  1118.  
  1119.        Description:   This is 5 bytes containing the Bitmaps of the
  1120.                       conferences the user is registered in.
  1121.                       They are in their "raw" form and will have to
  1122.                       be decoded before used and encoded before
  1123.                       storing.  Routines are available from the
  1124.                       support BBS.
  1125.  
  1126.        ck_user.expire_conf
  1127.        ------------------------------------------------------------------
  1128.        Defined As:    BYTE    ck_user.expire_conf[6]
  1129.  
  1130.        Description:   This is 5 bytes containing the Bitmaps of the
  1131.                       conferences the user is registered in after
  1132.                       his/her expiration date.
  1133.                       They are in their "raw" form and will have to
  1134.                       be decoded before used and encoded before
  1135.                       storing.  Routines are available from the
  1136.                       support BBS.
  1137.  
  1138.        ck_user.scan_conf
  1139.        ------------------------------------------------------------------
  1140.        Defined As:    BYTE    ck_user.scan_conf[6]
  1141.  
  1142.        Description:   This is 5 bytes containing the Bitmaps of the
  1143.                       conferences the user is registered in and
  1144.                       desires a mail scan.
  1145.                       They are in their "raw" form and will have to
  1146.                       be decoded before used and encoded before
  1147.                       storing.  Routines are available from the
  1148.                       support BBS.
  1149.  
  1150.        ck_user.dload_total          see also dload_total
  1151.        ------------------------------------------------------------------
  1152.        Defined As:    double    ck_user.dload_total
  1153.  
  1154.        Description:   This variable holds the user total downloaded
  1155.                       bytes determined from USER file.  This variable
  1156.                       is in it's raw Qbasic MKD$.  To be of use to
  1157.                       C, it needs to be converted from QBASIC real
  1158.                       to C's IEEE float.  The conversion/example routines
  1159.                       are available from the support BBS. Before changing
  1160.                       this variable it should also be converted back to a
  1161.                       QBASIC real.
  1162.  
  1163.                                                           Global Variables
  1164.  
  1165.         These are part of the structure "ck_user" as defined in the
  1166.         CKIT.H file.  Information available from user file.
  1167.  
  1168.        ck_user.upload_total         see also dload_total
  1169.        ------------------------------------------------------------------
  1170.        Defined As:    double    ck_user.upload_total;
  1171.  
  1172.        Description:   This variable holds the user total uploaded
  1173.                       bytes determined from USER file.  This variable
  1174.                       is in it's raw Qbasic MKD$.  To be of use to
  1175.                       C, it needs to be converted from QBASIC real
  1176.                       to C's IEEE float.  The conversion/example routines
  1177.                       are available from the support BBS. Before changing
  1178.                       this variable it should also be converted back to a
  1179.                       QBASIC real.
  1180.  
  1181.        ck_user.delete_user
  1182.        ------------------------------------------------------------------
  1183.        Defined As:    char    ck_user.delete_user[2];
  1184.  
  1185.        Description:   This C string is an ASCII string of delete
  1186.                       user flag. (Y or N)
  1187.  
  1188.  
  1189.        ck_user.last_msg_read        see also dload_total
  1190.        ------------------------------------------------------------------
  1191.        Defined As:    long   ck_user.last_msg_read;
  1192.  
  1193.        Description:   This variable holds the user last message read
  1194.                       in the main conference.  This variable
  1195.                       is in it's raw Qbasic MKS$.  To be of use to
  1196.                       C, it needs to be converted from QBASIC real
  1197.                       to C's IEEE float.  The conversion/example routines
  1198.                       are available from the support BBS. Before changing
  1199.                       this variable it should also be converted back to a
  1200.                       QBASIC real.
  1201.  
  1202.        ck_user.last_read            see also dload_total
  1203.        ------------------------------------------------------------------
  1204.        Defined As:    long      ck_user.last_read[39]
  1205.  
  1206.        Description:   This variable array contains the  last
  1207.                       read message pointers for conferences 0-39.
  1208.                       They are in raw Qbasic MKS$.  To be of use to
  1209.                       C, it needs to be converted from QBASIC real
  1210.                       to C's IEEE float.  The conversion/example routines
  1211.                       are available from the support BBS. Before changing
  1212.                       this variable it should also be converted back to a
  1213.                       QBASIC real.
  1214.  
  1215.                                                  System  Global Variables
  1216.  
  1217.         These variables are available with any BBS system.  Some are used
  1218.         for customization of your door program and MUST be defined.
  1219.         Others using are meant to be read only variables available globally.
  1220.         Some are are used in conjuction with high level functions as noted.
  1221.  
  1222.        char     progname[]         pcboard.sys door.sys wildcat! generic
  1223.        ------------------------------------------------------------------
  1224.        Defined as:    char   progname[21];
  1225.  
  1226.        Description:   Set this to your Door program name.  It will be
  1227.                       display on the status line on the sysop screen.
  1228.                       MAXIMUM length is 20 characters! Do not exceed this!
  1229.  
  1230.        NOTE: THIS IS NOT AN OPTION. You must define progname[] even if
  1231.              you do not plan on using it.
  1232.  
  1233.        ck_cmdline[]                 pcboard.sys door.sys wildcat! generic
  1234.        ------------------------------------------------------------------
  1235.        Defined as:    BYTE    ck_cmdline[128]
  1236.  
  1237.        Description:   This is used by get_cmdline(), to read the user
  1238.                       keyboard input to.
  1239.                       Please see the CKITDEMO.C for usage.
  1240.  
  1241.        See Also:      ck_get_cmdline();
  1242.  
  1243.        ck_par[]                     pcboard.sys door.sys wildcat! generic
  1244.        ------------------------------------------------------------------
  1245.        Defined as:    char    ck_par[128];
  1246.  
  1247.        Description:   This is used by get_nextpar(), to parse stacked
  1248.                       commands to.
  1249.                       Please see CKITDEMO.C for usage.
  1250.  
  1251.        See Also:      ck_get_cmdline(), ck_get_nextpar();
  1252.  
  1253.        ck_scan_code                 pcboard.sys door.sys wildcat! generic
  1254.        ------------------------------------------------------------------
  1255.        Defined as:    size_t  ck_scan_code;
  1256.  
  1257.        Description:   This variable will if NONZERO  contain the key_code
  1258.                       of any NON-STANDARD keys on the IBM keyboard.
  1259.                       (F1-F10, PgDn, PgUp etc).  The remote user must be
  1260.                       in some type of terminal program that will allow
  1261.                       passing the keycodes.  Qmodem in "DOORWAY" mode
  1262.                       is one example.
  1263.                       Please see ck_input(), ck_get_cmdline() and
  1264.                       ckitdemo.c for examples.
  1265.  
  1266.        See Also:      ck_get_cmdline();
  1267.  
  1268.         ck_key_source               pcboard.sys door.sys wildcat! generic
  1269.        ------------------------------------------------------------------
  1270.        Defined as:    short   ck_key_source;
  1271.  
  1272.        Description:   This variable will a 1 if the input from get_cmdline()
  1273.                       came from the LOCAL console or a 2 if it came from
  1274.                       a REMOTE console.
  1275.  
  1276.        See Also:      ck_get_cmdline(), ck_input()
  1277.  
  1278.                                                  System  Global Variables
  1279.  
  1280.         ck_linenum                  pcboard.sys door.sys wildcat! generic
  1281.        ------------------------------------------------------------------
  1282.        Defined as:    short   ck_linenum;
  1283.  
  1284.        Description:   This variable be will incremented each time a call
  1285.                       to newline() is made.
  1286.  
  1287.  
  1288.        See Also:      ck_page_length, ck_newline()
  1289.  
  1290.  
  1291.        ck_logoff_msgs               pcboard.sys door.sys wildcat! generic
  1292.        ------------------------------------------------------------------
  1293.        Defined as:    char    **ck_logoff_msgs;
  1294.  
  1295.     Description:
  1296.     This is pointer to an array of pointers that will be printed at the
  1297.     time the door is closed.  The array of pointers has a length of 6
  1298.     elements. Which message is printed depends on the value of ck_option.
  1299.     The code looks for an array of pointers to the exit messages and uses
  1300.     the ck_option variable to pick which one to print.    This pointer to
  1301.     the array of pointers allows you to define your own array of pointers
  1302.     to the 6 exit messages.  This allows the messages to be of any length
  1303.     and which message printed will be based on the value of ck_option (0-5)
  1304.     respectfully.  See also the variable ck_option.
  1305.     They must be in this order.
  1306.  
  1307.     Example to create your own log off messages of ANY size.
  1308.     In your source code:
  1309.  
  1310.         char    option0[] = "New Returning to system msg, any size\n";
  1311.         char    option1[] = "New CARRIER DROPPED! msg, any size\n";
  1312.         char    option2[] = "New Keyboard Timeout! msg, any size\n";
  1313.         char    option3[] = "New Sysop requests return to BBS msg, any size\n";
  1314.         char    option4[] = "New System time has expired! msg, any size\n";
  1315.         char    option5[] = "New Thanks for calling! msg, any size";
  1316.  
  1317.         static  char    *logoffs[6] = {         /* create array of ptrs */
  1318.                 option0,
  1319.                 option1,
  1320.                 option2,
  1321.                 option3,
  1322.                 option4,
  1323.                 option5,
  1324.         };
  1325.  
  1326.     ck_logoff_msgs = &logoffs[0]; /* Set C-KIT's pointer to custom messages*/
  1327.  
  1328.                                                  System  Global Variables
  1329.  
  1330.        ck_logoff_msgs  <cont.>
  1331.        ------------------------------------------------------------------
  1332.  
  1333.       You do NOT have to define your own log off messages.  C-KIT has
  1334.     it's own internal defaults.  If you want to change just one individual
  1335.     log off message and leave the rest alone, then you can use the pointer
  1336.     that is initially contained in **ck_logoff_msgs and index to the one
  1337.     you want to change.  Doing this will limit the size to the max.
  1338.     indicated for that message.  The limits on changing individual logoff
  1339.     internal library messages are:
  1340.  
  1341.         MAX SIZE!
  1342.         ========
  1343.         option0[40] /* internal "returning to board" msg  */
  1344.         option1[16] /* internal "NO CARRIER!!"       msg  */
  1345.         option2[40] /* internal "keyboard timeout"   msg  */
  1346.         option3[48] /* internal "sysop request"      msg  */
  1347.         option4[36] /* internal "time expired"       msg  */
  1348.         option5[40] /* internal "goodbye"            msg  */
  1349.  
  1350.  
  1351.     To change only one internal logoff library message, use the pointer
  1352.     that is originally contained in **ck_logoff_msgs.  Indexing from it,
  1353.     you can use strcpy() to change it.  EXAMPLE:
  1354.  
  1355.     To change only the "returning to board" msg.
  1356.  
  1357. IN YOUR source code:
  1358. char exit_msg[40] = "Returning to system\n";  /* Max 40 allocated in lib */
  1359. strcpy(*(ck_logoff_msgs), exit_msg);   /* Using the orignal pointer,
  1360.                                           copy new string */
  1361.  
  1362.     To change only the "goodbye" msg.
  1363.  
  1364. IN YOUR source code:
  1365. char logoff_msg[40] = "Thanks for calling\n";  /* Max 40 allocated in lib  */
  1366. strcpy(*(ck_logoff_msgs + 5), logoff_msg);     /* Use the original pointer */
  1367.  
  1368.     Again, you can provide your own array of pointers and change  all
  1369.     the messages to any size desired.  Look at the ckitdemo.c, ckitdemo.h.
  1370.  
  1371.                                                  System  Global Variables
  1372.  
  1373.        ck_gen_msgs                  pcboard.sys door.sys wildcat! generic
  1374.        ------------------------------------------------------------------
  1375.        defined as:    char    **ck_gen_msgs;
  1376.  
  1377.        Description:
  1378.  
  1379.     This is pointer to an array of pointers that are C-KIT's internal
  1380.     messages. The array of pointers has a length of 12 elements.
  1381.     The code looks for an array of pointers to index which message to
  1382.     print.  This pointer to the general array of pointers allows you to
  1383.     define your own array of pointers to the 12 internal messages.  The
  1384.     messages can be of any length and which  message printed will be based
  1385.     their position in the array.
  1386.     The ordering of the array is -
  1387.  
  1388.  0  -  Screen display on message
  1389.  1  -  Event pending warning, time adjusted
  1390.  2  -  Press enter to continue message, used with FORCE_ENTER.
  1391.  3  -  Sysop chat active msg
  1392.  4  -  Sysop chat end msg
  1393.  5  -  Sysop exited to DOS msg
  1394.  6  -  Sysop back from DOS msg
  1395.  7  -  (Enter=none)? msg used in get_defn() and get_defen()
  1396.  8  -  (Enter=yes)   msg used in get_defyn()
  1397.  9  -  (Enter=no)    msg used in get_defyn()
  1398.  10 -  (Enter) or (Y)es, (N)o, (NS)nonstop? msg used in no_more & display_file
  1399.  11 -  More:   - msg used in no_more and display_file
  1400.  
  1401.     ck_gen_msgs = &ckitmsgs[0];   /* Set pointer to custom message ptrs */
  1402.  
  1403.     You do NOT have to define these  messages.  C-KIT has it's own internal
  1404.     defaults.  If you want to change just one individual message and
  1405.     leave the rest alone, then you can use the pointer  that is initially
  1406.     contained in **ck_gen_msgs and index to the one you want to change.
  1407.     Doing this will limit the size to the max. indicated for that message.
  1408.     The limits on changing individual general internal library messages are:
  1409.  
  1410.         MAX SIZE!
  1411.         ========
  1412.         msg0[18]  /* internal "Screen on"        msg   */
  1413.         msg1[44]  /* internal "Event pending"    msg   */
  1414.         msg2[28]  /* internal "Enter to cont."   msg   */
  1415.         msg3[48]  /* internal "Sysop Chat"       msg   */
  1416.         msg4[18]  /* internal "Chat end"         msg   */
  1417.         msg5[42]  /* internal "Exit to DOS"      msg   */
  1418.         msg6[40]  /* internal "Return from DOS"  msg   */
  1419.         msg7[14]  /* internal "prompt1"          msg   */
  1420.         msg8[12]  /* internal "prompt2"          msg   */
  1421.         msg9[10]  /* internal "prompt3"          msg   */
  1422.         msg10[38] /* internal "prompt4"          msg   */
  1423.         msg11[6]  /* internal "More:  "          msg   */
  1424.  
  1425.                                                  System  Global Variables
  1426.        ck_gen_msgs  <cont.>
  1427.        ------------------------------------------------------------------
  1428.  
  1429.     To change only one internal general library message, use the pointer
  1430.     that is originally contained in **ck_gen_msgs.  Indexing from it,
  1431.     you can use strcpy() to change it.  EXAMPLE:
  1432.  
  1433.     To change only the "Screen display on" msg.
  1434.  
  1435. IN YOUR source code:
  1436. char display_msg[18] = "<Screen ON>";  /* Max 18 allocated in lib */
  1437. strcpy(*(ck_gen_msgs), display_msg);   /* Using the orignal pointer,
  1438.                                           copy new string */
  1439.  
  1440.     To change only the "Exited to DOS" msg.
  1441.  
  1442. IN YOUR source code:
  1443. char dos_ret_msg[42] = "Sysop exited to DOS\n";  /* Max 42 allocated in lib  */
  1444. strcpy(*(ck_gen_msgs + 6), dos_ret_msg);         /* Use the original pointer */
  1445.  
  1446.     Again, you can provide your own array of pointers and change  all
  1447.     the messages to any size desired.  Look at the ckitdemo.c, ckitdemo.h.
  1448.  
  1449.  
  1450.  
  1451.        ck_system_time_HHMMSS[]      pcboard.sys door.sys wildcat! generic
  1452.        ------------------------------------------------------------------
  1453.        Defined as:    char    ck_system_time_HHMMSS[9];
  1454.  
  1455.        Description:   This string will contain the current system time
  1456.                       in the form HH:MM:SS and is available for general use.
  1457.  
  1458.  
  1459.        ck_todays_date_MMDDYY[]      pcboard.sys door.sys wildcat! generic
  1460.        ------------------------------------------------------------------
  1461.        Defined as:    char    ck_todays_date_MMDDYY[9];
  1462.  
  1463.        Description:   This string will contain the current system date
  1464.                       in the form MM:DD:YY and is available for general use.
  1465.  
  1466.  
  1467.        ck_error_msg11[]             pcboard.sys door.sys wildcat! generic
  1468.        ------------------------------------------------------------------
  1469.        Defined as:    char    ck_error_msg11[40];
  1470.  
  1471.        Description:   Error message used by display_file.  If you do not
  1472.                       define this, C-KIT will default to it's standard
  1473.                       error message.  MAX. 40 chars. (not including NULL).
  1474.  
  1475.        ck_chatmode                  pcboard.sys door.sys wildcat! generic
  1476.        ------------------------------------------------------------------
  1477.        Defined as:    short   ck_chatmode;
  1478.  
  1479.        Description:   This variable will a 1 (TRUE) if chat mode or a
  1480.                       sysop drop to DOS has been active.  Use this to
  1481.                       re-fresh your screen if needed. It is YOUR responsiblity
  1482.                       to de-assert the variable after you have used it.
  1483.                       (set to FALSE)
  1484.  
  1485.                                                  System  Global Variables
  1486.        ck_DOTS
  1487.        ------------------------------------------------------------------
  1488.        Defined as:    BYTE   ck_DOTS;
  1489.  
  1490.        Description:   This variable when set to a non-zero value will
  1491.                       echo that value (character) to the to the remote/
  1492.                       local screens when using input() or get_cmdline().
  1493.                       For instance, setting ck_DOTS to a '.' will cause
  1494.                       dots to be echoed to the screen.  Handy for using
  1495.                       with passwords etc.  Resetting back to a NULL will
  1496.                       resume normal operations.
  1497.  
  1498.  
  1499.  
  1500.                                                        Standard Data Types
  1501.  
  1502.                                Standard Data Types
  1503.  
  1504.        CKIT.H  defines a number of useful data types.
  1505.  
  1506.        BYTE
  1507.        -------------------------------------------------------------------
  1508.        Defined As:    typedef unsigned char  BYTE;
  1509.  
  1510.        Description:   The  BYTE data type is useful in serial communications
  1511.                       since it provides an easier and more logical way of
  1512.                       handling 8 bit data from UART's used in serial
  1513.                       communications.
  1514.  
  1515.  
  1516.  
  1517.  
  1518.                                                                  Functions
  1519.  
  1520.                                     Functions
  1521.  
  1522.        The  C-KIT Library contains a variety  of functions.
  1523.        They are described as follows:
  1524.  
  1525.        Summary:       Presents  an exact syntactic  model for each  of the
  1526.                       C-KIT Library functions.
  1527.  
  1528.        Description:   Describes a function's purpose and how it is used in
  1529.                       an application program.
  1530.  
  1531.        Return Value:  Explains  any of the  possible return values  for a
  1532.                       C-KIT Library function.
  1533.  
  1534.        See Also:      Lists any similar or related C-KIT Library  function.
  1535.  
  1536.        Example:       Illustrates how  a  C-KIT Library  function could
  1537.                       actually be used in an application program.
  1538.                       Most function listed in the examples will be simply
  1539.                       listed as function().  This may not indicate how
  1540.                       they are called.  To see how they are prototyped and
  1541.                       called go to that function's page.
  1542.                       I.E. If open_door is used in an example (other than
  1543.                       it's own example) it may be simply refered to as
  1544.                       open_door().
  1545.                       In reality open_door is really open_door(char * ...);
  1546.  
  1547.        The library functions are classified as 3 different types.
  1548.        High level, intermediate and low level.   Normally a door would
  1549.        not need to make use of any of the functions except the high
  1550.        level functions.  These handle and watch all the system
  1551.        timeouts, carrier detects, keyboard timeouts etc.
  1552.        If you need more control, there are other functions available.
  1553.        I will warn you.  The lower level function you use, the less
  1554.        it will check for you automatically.  Do not use these unless
  1555.        you have to.
  1556.  
  1557.                                                                  Functions
  1558.        ck_open_door
  1559.        -------------------------------------------------------------------
  1560.        Summary:       #include "ckit.h"
  1561.                       short ck_open_door();
  1562.  
  1563.        Description:  The open door function initializes vectors, reads bbs
  1564.                      system information.    THIS MUST BE CALLED FIRST!
  1565.                      The first pointer should be be the path/name to the
  1566.                      system file. The second pointer should be the path/name
  1567.                      to the users file, if you designated USERSFILE=TRUE.
  1568.                      open_door() will also accept a pointer to a data
  1569.                      structure if ck_NOSYSTEM is TRUE.
  1570.                      (for pcboard systems only).  As long as you have defined
  1571.                      USERSFILE = FALSE, C-KIT will not attempt to use the
  1572.                      second pointer. Which ever you specify, the PORT:AAAA:X
  1573.                      (if used) must be the last parameter passed to
  1574.                      open_door();.
  1575.                      Close_door MUST be called before exiting program  after a
  1576.                      call to open_door. See the CKITDEMO.C for more examples.
  1577.  
  1578.        Return Value:  Will return NULL is successful, otherwise it will return
  1579.                       an error code listed below.
  1580.  
  1581.        See Also:      ck_close_door
  1582.  
  1583.        Example:  This example assumes the path\filenames passed on the command
  1584.                   line.  i.e  program_name path\filename path\filename port
  1585.  
  1586.        #include "ckit.h"
  1587.        short     result;
  1588.        main(int argc, char **argv) {
  1589.          if (argc > 0) {
  1590.            if(!ck_open_door(argv[1], argv[2], argv[3]));    <--- NOTE:
  1591.                   display_info();                                argv[2] and
  1592.                   your_main_program();                           argv[3] are
  1593.            } else {                                              optional.
  1594.                   printf("Error opening door!");                 see below.
  1595.            }
  1596.            ck_close_door();
  1597.            exit(0);
  1598.          }
  1599.        }
  1600.  
  1601.     open_door() returns these codes:
  1602.  
  1603.         0   ;Successful
  1604.         1   ;Unable to open BBS system file (pcboard.sys,door.sys etc)
  1605.         2   ;Problem reading BBS system file
  1606.         3   ;Unrecognized BBS file type
  1607.         4   ;Unable to open pcboard USERS file
  1608.         5   ;Invalid User record or problem seeking to user record
  1609.         6   ;Problem reading USER record
  1610.         7   ;PORT command syntax error
  1611.         8   ;Fossil driver specified but no Fossil driver installed
  1612.         9   ;Memory allocation problem
  1613.  
  1614.  
  1615.                                                                  Functions
  1616.        ck_open_door  <cont.>
  1617.        -------------------------------------------------------------------
  1618.  
  1619. NOTE: Both PORT and USERSFILE are optional. If a user of your door needed to
  1620. specify a non-standard port address and IRQ, then the syntax is PORT:AAAA:X
  1621. where AAAA is the base address and X is the IRQ. It doesn't matter whether
  1622. PORT:AAAA:X is the second or third parameter (depending on if you were
  1623. opening the user file) passed to open_door() as long as it is the LAST
  1624. parameter passed.
  1625.  
  1626. Note also it does not matter which order on the cmd line the arguments are
  1627. listed. The only thing that matters is which order they are passed to the
  1628. open_door() function itself.  You could also have the system path as part of
  1629. a config file for your door.  Then you would read your config file and pass
  1630. the path read from it to open_door() as a string ptr.
  1631. PORT is optional, and C-KIT will default to standard addresses and irq's
  1632. if PORT is not used based on the port number read from the BBS file.
  1633. C-KIT will assume COM1 = 03F8 IRQ 4, COM2 = 02E8 IRQ3, COM3 = 03E8 IRQ4
  1634. and COM4 = 02E8 IRQ 3.  If the sysop had a different non-standard
  1635. port address and irq, he could then use the PORT cmd to change the
  1636. defaults.  For this reason, you should include the usage of PORT in
  1637. your door program and documenation.
  1638.  
  1639. Below is some examples of how your program would/could be called up
  1640. and how the open_door() function would be called.  Notice PORT is always
  1641. the second or third (last) argument to be passed if a user of your door
  1642. program wanted to use it.
  1643.  
  1644.   C-KIT will also support the use of FOSSIL drivers.  The syntax for a FOSSIL
  1645. driver is: PORT:F:P. The 'F' tells C-KIT to use a Fossil driver for it's
  1646. communications.  The 'P' following it tells it which port to use for the
  1647. Fossil. Example - PORT:F:1, tells C-KIT to use a fossil driver for port 1.
  1648. YOU AS A DOOR AUTHOR SHOULD ALSO INCLUDE THIS INFORMATION IN YOUR DOOR
  1649. DOCUMENTATION FILES AND INCLUDE IT IN YOUR CALL TO OPEN_DOOR().
  1650.  
  1651. open_door() works like this.  It will expect the first pointer to
  1652. be a string pointer to the BBS system file, always.  Next, it checks
  1653. to see if USERSFILE = TRUE.  If so, it will expect the second pointer
  1654. to be a string pointer to a PCBoard users file.  If USERSFILE is
  1655. FALSE it will not look for a users file.  Either case, open_door()
  1656. will search the stack frame pointers for the word "PORT" for the
  1657. 2nd and 3rd string pointers passed.  If it finds it, it will utilize
  1658. it.  If not, it will use the default port addresses/irq's defined
  1659. above for the COM port read from the system file.  For this reason,
  1660. open_door() will work whether there is actually a port command being
  1661. passed or not.  You as the door author should provide the users of your
  1662. door the ability to pass the port command if they are using NON-STANDARD
  1663. ports.
  1664.  
  1665.  
  1666.                                                                  Functions
  1667.        ck_open_door (cont.)
  1668.        -------------------------------------------------------------------
  1669.  
  1670. EXAMPLES: Assume door.cfg below is a config file that your door programs reads.
  1671. This all depends on how or what is desired for your door program.  You would
  1672. need to document in your door documentation what order the cmd line should
  1673. be for your door program, OR read your config file and pass the system name
  1674. and path to open_door().  You should also include info about the PORT:AAAA:X
  1675. in your docs.
  1676.  
  1677.  
  1678. Here is a short example of reading a config file and passing the system
  1679. name and path.
  1680. (Assuming the 1st line in the config file has the system path\name)
  1681.     main(int argc, char **argv) {
  1682.     short   handle, bytes_read;
  1683.     char    bbssyspath[81];
  1684.  
  1685.     handle = open(argv[1], O_RDONLY);             /* Open config file */
  1686.     bytes_read = read(handle, bbssyspath, 80);    /* Read system path\name */
  1687.     bbssyspath[bytes_read - 1] = '\0';            /* Null terminate */
  1688.     close(handle);                                /* Close config file */
  1689.     ck_open_door(bbssyspath, argv[2]);      /* include arg2 for the PORT cmd */
  1690.     ck_close_door();
  1691.  
  1692.     }
  1693.  
  1694. Your program's cmd line for the above could be any one of the following:
  1695.  
  1696. doorprgm  config.cfg                    ;Using standard ports
  1697. doorprgm  config.cfg PORT:03E8:5        ;Using non-standard port
  1698. doorprgm  config.cfg PORT:F:1           ;Using a fossil driver on port 1
  1699.  
  1700.  You may not need or want a config file for your door program so you could
  1701.  just simply have the sysop pass the system infomation on the command line.
  1702.  If this is the case, your program's cmd line could be any of the following:
  1703.  
  1704. doorprgm c:\wc\callinfo.bbs              ;Using standard ports
  1705. doorprgm c:\wc\callinfo.bbs PORT:03F8:5  ;Using non-standard port
  1706. doorprgm c:\wc\callinfo.bbs PORT:F:1     ;Using a fossil driver on port 1
  1707.  
  1708.   Again, you as the door author would explain in your documentation how the
  1709. sysop would set your door program up depending on how you decide to handle
  1710. reading the system files.  Just be sure and include information about the
  1711. PORT:AAAA:X and PORT:F:P commands as well.
  1712.  
  1713.  
  1714.                                                                  Functions
  1715.        ck_open_door (cont.)
  1716.        -------------------------------------------------------------------
  1717.  
  1718. HIGHLY RECOMMEDED!:
  1719.      You should include in your door source code C's atexit() function.
  1720. Then have it call a function that will test if door_open() has been called
  1721. or if close_door() has already been called.  Then if your program has a
  1722. runtime error, you will call close_door() so all interrupts vectors can be
  1723. restored and prevent a system crash.  Take a look at ckitdemo.c.
  1724. EXAMPLE:
  1725.  
  1726. short       OPENED;             /* Flag to know if open_door has been called  */
  1727. short       CLOSED;             /* Flag to know if close_door has beeb called */
  1728. void        shut_down(void);    /* Shuts door down if normal or error occurs. */
  1729.  
  1730. main(int argc, char **argv) {
  1731.  
  1732.         open_door(argv[1], argv[2]);
  1733.         OPENED = TRUE;              /* Door has been opened  */
  1734.         atexit(shut_down);
  1735.         .
  1736.         .
  1737.         .
  1738.  }
  1739.  
  1740. /****************************************************************************
  1741.  *      Close door, reset vectors etc.                                      *
  1742.  *  Need in case of a run time error occurs in door                         *
  1743.  *  and to check if a call to close_door needs to be made.                  *
  1744.  ****************************************************************************/
  1745.  void   shut_down(void) {
  1746.     if(OPENED && !CLOSED) {
  1747.         close_door();
  1748.         CLOSED = TRUE;
  1749.     }
  1750. }
  1751.  
  1752.  
  1753.                                                                  Functions
  1754.        ck_open_door (cont.)
  1755.        -------------------------------------------------------------------
  1756.  
  1757.   Another way open_door() can be used is thru the use of a data structure
  1758. defined as:
  1759.  
  1760. typedef struct ckitgeneric {
  1761.     char port[6];                   /* COM:?  */
  1762.     short min_left;                 /* minutes left */
  1763. };
  1764.  
  1765. This allows you to support BBS programs in your door program that are not
  1766. supported directly by Ckit.  To do this, you would read the BBS system
  1767. file yourself.  Obtain the necassary information for the data structure,
  1768. set ck_NOSYSTEM = TRUE, then call open_door().  Below is a short example
  1769. of reading a WWIV file.  (WWIV is not directly supported by CKIT).
  1770.  
  1771.  
  1772. typedef struct ckitgeneric {
  1773.     char port[6];            /* COM:x  (COM0: is local) */
  1774.     short min_left;          /* minutes left */
  1775. };
  1776.  
  1777. struct ckitgeneric  ck_gen;  /* You can name this whatever you want */
  1778.  
  1779. char *ptr;
  1780.  
  1781. if(WWIV) {
  1782.      open_file(bbs_system_file);
  1783.      read_file(bbs_system_file);
  1784.      setup_ck_gen();                    /* set up data structure */
  1785.      ck_NOSYSTEM = TRUE;
  1786.      ptr = &bbs_system_file);
  1787. } else {
  1788.      ptr = &bbs_system_file;
  1789.      ck_NOSYSTEM = FALSE;
  1790. }
  1791.  
  1792. open_door(ptr,  argv[2]); (2nd arg is for passing the PORT:AAAA:X cmd)
  1793.  
  1794. Take a look at the ckitdemo.c file for a complete example.
  1795.  
  1796.  
  1797.  
  1798.                                                            Functions
  1799.        ck_close_door                             high level
  1800.        -------------------------------------------------------------------
  1801.        Summary:       #include "ckit.h"
  1802.                       void ck_close_door(void);
  1803.  
  1804.        Description:   The close door function resets vectors, closes
  1805.                       files opened and prints the log off message.
  1806.                       THIS MUST BE CALLED LAST and ONLY after open_door().
  1807.                       Close_door MUST be called before exiting program
  1808.                       after a call has been made to open_door.
  1809.                       Not doing so will certainly cause a system lock up.
  1810.                       See above for using C's atexit() function.
  1811.                       Version 2.0 and above, close_door will check if
  1812.                       open_door has been called or if close_door() has
  1813.                       already been called to help further prevent any
  1814.                       system hangups.
  1815.  
  1816.        Return Value:  No value is returned.
  1817.  
  1818.        See Also:      ck_open_door.
  1819.  
  1820.        Example:
  1821.  
  1822.        #include "ckit.h"
  1823.        main(int argc, char **argv) {
  1824.          if (argc > 0) {
  1825.            ck_open_door("d:\wc\callinfo.bbs");
  1826.            .
  1827.            .
  1828.            .
  1829.            . your door program
  1830.            .
  1831.            .
  1832.            ck_close_door();
  1833.          };
  1834.        };
  1835.  
  1836.  
  1837.                                                                  Functions
  1838.  
  1839.        ck_update_user      PCBOARD 14.5 only        high level
  1840.        -------------------------------------------------------------------
  1841.        Summary:       #include "ckit.h"
  1842.                       void ck_update_user();
  1843.  
  1844.        Description:   The update user will accept a POINTER to the
  1845.                       user structure member to update.  See the
  1846.                       user structure above.  This function will only
  1847.                       work for PCBoard 14.5 and USERSFILE must be set
  1848.                       TRUE.  C-KIT will update the user file when the
  1849.                       door is closed.  If you do not want C-KIT to update
  1850.                       the user record after a change has been made
  1851.                       set USERSFILE = FALSE before calling close_door();
  1852.                       If you use this function you should set the compiler
  1853.                       to use WORD alignment for C-kit v.2.01 and below.
  1854.                       NOTE: IN VERSION 2.08 AND ABOVE, YOU NEED TO USE
  1855.                             BYTE ALIGNMENT!
  1856.  
  1857.        Return Value:  No value is returned.
  1858.  
  1859.        See Also:      ck_user structure
  1860.  
  1861.        Example: Change user security and comment1 field.
  1862.                 MOTICE THE & BELOW!.  You MUST pass the address of the
  1863.                 member to update in the user structure.
  1864.  
  1865.        #include "ckit.h"
  1866.        main(int argc, char **argv) {
  1867.        USERSFILE = TRUE;
  1868.        static char new_comment[] = "ckit_user";
  1869.        if (argc > 1) {
  1870.            ck_open_door(argv[1], argv[2]); (pass system file and PORT cmd)
  1871.            .
  1872.            .
  1873.            .
  1874.            ck_usersecurity = 50;
  1875.            ck_update_user(&ck_usersecurity);
  1876.            strcpy(ck_usercomment1, new_comment);
  1877.            ck_update_user(&ck_usercomment1);
  1878.            .
  1879.            .
  1880.            .
  1881.            ck_close_door();
  1882.          };
  1883.        };
  1884.  
  1885.                                                                  Functions
  1886.  
  1887.        ck_s_puts                                  high level
  1888.        -------------------------------------------------------------------
  1889.        Summary:       #include "ckit.h"
  1890.                       void ck_s_puts(char *);
  1891.  
  1892.        Description:   The s_puts function displays a single NULL termintated
  1893.                       (C string) to the local and remote console. It expects
  1894.                       a pointer to the string of type BYTE or char
  1895.                       to be displayed.  It will not handle ANSI.  See
  1896.                       ck_s_putstd() for ANSI and other usage.
  1897.  
  1898.        Return Value:  No value is returned.
  1899.  
  1900.        See Also:      s_printf, ck_s_putv, ck_s_putc, ck_s_putsn
  1901.  
  1902.        Example:
  1903.  
  1904.        #include "ckit.h"
  1905.        static BYTE string[] = "This is a test";
  1906.        main(int argc, char **argv) {
  1907.          if (argc > 1) {
  1908.            ck_open_door(argv[1]); /* pass system file(s) */
  1909.            .
  1910.            .
  1911.            .
  1912.            ck_s_puts(string);
  1913.            ck_s_puts("This is also a test");
  1914.            .
  1915.            .
  1916.            .
  1917.            ck_close_door();
  1918.          };
  1919.        };
  1920.  
  1921.  
  1922.                                                                 Functions
  1923.  
  1924.        ck_s_putstd                                  high level
  1925.        -------------------------------------------------------------------
  1926.        Summary:       #include "ckit.h"
  1927.                       void ck_s_putstd(char *);
  1928.  
  1929.        Description:   The s_putstd function displays a single NULL termintated
  1930.                       (C string) to the local and remote console. It expects
  1931.                       a pointer to the string of type BYTE or char
  1932.                       to be displayed. This function is identical to s_puts
  1933.                       except it uses std output.
  1934.                       This function should be used when ANSI code, or CTRL
  1935.                       chars are needed to be sent to the local and remote
  1936.                       consoles.
  1937.  
  1938.        Return Value:  No value is returned.
  1939.  
  1940.        See Also:      s_printf, ck_s_putv, ck_s_putc, ck_s_putsn
  1941.  
  1942.        Example:       Use s_putstd() to change background/foreground colors
  1943.                       #include "ckit.h"
  1944.  
  1945.        #define cyanblue        0
  1946.        #define yellowbrown     1
  1947.        #define redgreen        2
  1948.        #define redcyan         3
  1949.        #define cyanred         4
  1950.        #define cyanmagenta     5
  1951.        #define bluegrey        6
  1952.  
  1953.        static char *ansi_color[8]  = {
  1954.           "\33[0;1;36;44mCyan on Blue\33[40m"
  1955.           "\33[44m\33[33;43mYellow on Brown\33[40m"
  1956.           "\33[43m\33[0;31;42mRed on Green\33[40m"
  1957.           "\33[42m\33[46mRed on Cyan\33[40m"
  1958.           "\33[46m\33[1;36;41mCyan on Red\33[40m"
  1959.           "\33[41m\33[45mCyan on Magenta\33[40m"
  1960.           "\33[45m\33[0;34;47mBlue on Grey\33[0m"
  1961.        };
  1962.  
  1963.        main(int argc, char **argv) {
  1964.          if (argc > 0) {
  1965.            ck_open_door(argv[1]); /* pass system file(s) */
  1966.            .
  1967.            .
  1968.            .
  1969.            ck_s_putstd(ansi_color[cyanblue]);
  1970.            ck_s_putstd(ansi_color[yellowbrown]);
  1971.            ck_s_putstd(ansi_color[redgreen]);
  1972.            ck_s_putstd(ansi_color[redcyan]);
  1973.            ck_s_putstd(ansi_color[cyanred]);
  1974.            ck_s_putstd(ansi_color[cyanmagenta]);
  1975.            ck_s_putstd(ansi_color[bluegrey]);
  1976.            .
  1977.            .
  1978.            .
  1979.            ck_close_door();
  1980.          };
  1981.        };
  1982.  
  1983.  
  1984.                                                                  Functions
  1985.  
  1986.        ck_s_putv                                    high level
  1987.        -------------------------------------------------------------------
  1988.        Summary:       #include "ckit.h"
  1989.                       void ck_s_putv();
  1990.  
  1991.        Description:   The s_putv function displays a single NULL terminated
  1992.                       (C string) to the local and remote console. It expects
  1993.                       a variable argument of pointer(s) to the string(s)
  1994.                       of type BYTE or char to be displayed.  The list of
  1995.                       pointers MUST end with a NULL pointer!.  Not doing
  1996.                       so will most likely either cause garbage to printed
  1997.                       or even a hang-up.
  1998.  
  1999.        Return Value:  No value is returned.
  2000.  
  2001.        See Also:      s_printf, ck_s_puts, ck_s_putc, ck_s_putsn
  2002.  
  2003.        Example:       This example prints 2 strings with the pointer list
  2004.                       terminated with a NULL pointer.
  2005.  
  2006.        #include "ckit.h"
  2007.        static BYTE string[] = "This is a test";
  2008.        main(int argc, char **argv) {
  2009.          if (argc > 1) {
  2010.            ck_open_door(argv[1]); /* pass system file(s) */
  2011.            .
  2012.            .
  2013.            .
  2014.            static BYTE string[] = "This is a test";
  2015.            ck_s_putv(string, "This is also a test", NULL);
  2016.            .
  2017.            .
  2018.            .
  2019.            ck_close_door();
  2020.          };
  2021.        };
  2022.  
  2023. NOTE: an alternative to using s_putv would be to include the function
  2024.       s_printf() below in your source code.  You could use this function
  2025.       the same as you would printf();  This function has already been protyped
  2026.       in CKIT.H
  2027.  
  2028.  
  2029.                                                                  Functions
  2030.        s_printf                               high level
  2031.        -------------------------------------------------------------------
  2032.        Summary:       #include "ckit.h"
  2033.                       void    s_printf(char *,...);
  2034.  
  2035.        Description:   The s_printf function is used to format an output
  2036.                       to be sent to the local and remote console. It is
  2037.                       exactly the same as the cprintf() function in C.
  2038.                       To use it, you must include the source code listed
  2039.                       below in your door program since s_printf() is NOT an
  2040.                       actual part of the C-KIT librarys.
  2041.                       NOTE: if you want to send ANSI strings, change the
  2042.                       s_puts in the s_printf function to s_putstd or create
  2043.                       another std_printf function using s_putstd as the
  2044.                       output.
  2045.  
  2046.        Return Value:  No value is returned.
  2047.  
  2048.        See Also:      s_printf, s_puts, s_putv
  2049.  
  2050. INCLUDE THIS SOURCE CODE IN YOUR DOOR PROGRAM TO USE S_PRINTF!
  2051. THE FUNCTION HAS ALREADY BEEN PROTOTYPED IN CKIT.H
  2052. MODIFY AS YOU NEED.
  2053. /****************************************************************************
  2054.  *      Printf() function for sending output to port                        *
  2055.  ****************************************************************************/
  2056. void s_printf(char *s_format,...) {
  2057.     va_list arg_pointer;
  2058.     char buffer[82];                    /*  string buffer for 81 chars */
  2059.     va_start(arg_pointer, s_format);
  2060.     vsprintf(buffer, s_format, arg_pointer);
  2061.     s_putstd(buffer);                  /* change to s_putstd() for ANSI */
  2062.     va_end(arg_pointer);
  2063. }
  2064.  
  2065.        Example:
  2066. /****************************************************************************
  2067.  *      sending a string out the port using s_printf()                      *
  2068.  ****************************************************************************/
  2069.        #include "ckit.h"
  2070.        short  number  34;
  2071.        main(int argc, char **argv) {
  2072.          if (argc > 1) {
  2073.            ck_open_door("c:\rbbs\dorinfo1.def", argv[1]);
  2074.            .
  2075.            .
  2076.            .
  2077.            s_printf("Hello, %s. The number is %d.", firstname, number);
  2078.            .
  2079.            .
  2080.            .
  2081.            ck_close_door();
  2082.          };
  2083.        };
  2084.  
  2085.  
  2086.                                                                  Functions
  2087.  
  2088.        ck_s_putsn                                   high level
  2089.        -------------------------------------------------------------------
  2090.        Summary:       #include "ckit.h"
  2091.                       void ck_s_putsn(char *);
  2092.  
  2093.        Description:   The s_putsn function displays a single NULL terminated
  2094.                       (C string) to the local console only.       It expects
  2095.                       a pointer to the string of type BYTE or char
  2096.                       to be displayed.
  2097.  
  2098.        Return Value:  No value is returned.
  2099.  
  2100.        See Also:      s_printf, ck_s_putv, ck_s_putc, ck_s_putstd
  2101.  
  2102.        Example:
  2103.  
  2104.        #include "ckit.h"
  2105.        static BYTE string[] = "This is a test";
  2106.        main(int argc, char **argv) {
  2107.          if (argc > 1) {
  2108.            ck_open_door(argv[1], argv[2]); (include arg2 for the PORT cmd)
  2109.            .
  2110.            .
  2111.            .
  2112.            static BYTE string[] = "This is a test";
  2113.            ck_s_putsn(string);
  2114.            ck_s_putsn("This is also a test");
  2115.            .
  2116.            .
  2117.            .
  2118.            ck_close_door();
  2119.          };
  2120.        };
  2121.  
  2122.  
  2123.                                                                  Functions
  2124.  
  2125.        ck_s_putc                                high level
  2126.        -------------------------------------------------------------------
  2127.        Summary:       #include "ckit.h"
  2128.                       void ck_s_putc(BYTE);
  2129.  
  2130.        Description:   The s_putc function displays a single BYTE or char
  2131.                       to the local and remote console.
  2132.  
  2133.        Return Value:  No value is returned.
  2134.  
  2135.        See Also:      s_printf, ck_s_puts, ck_s_putc.
  2136.  
  2137.        Example:       This example prints a single BYTE (ASCII A) to local
  2138.                       and remote console.
  2139.  
  2140.        #include "ckit.h"
  2141.        BYTE byte_to_send = 0x41;
  2142.        short   handle, bytes_read;
  2143.        char    pcbsyspath[81];
  2144.        main(int argc, char **argv) {
  2145.        if (argc > 1) {
  2146.             handle = open(argv[1], O_RDONLY);
  2147.             bytes_read = read(handle, pcbsyspath, 80);
  2148.             pcbsyspath[bytes_read - 1] = '\0';
  2149.             close(handle);
  2150.             open_door(pcbsyspath, argv[2]); (include arg2 for the PORT cmd)
  2151.             ck_s_putc(byte_to_send);
  2152.             ck_close_door();
  2153.           };
  2154.        };
  2155.  
  2156.                                                                 Functions
  2157.  
  2158.        ck_newline                               high level
  2159.        -------------------------------------------------------------------
  2160.        Summary:       #include "ckit.h"
  2161.                       void ck_newline(void);
  2162.  
  2163.        Description:   The newline function sends a Carriage Return/
  2164.                       Line Feed to the local and remote console.
  2165.                       Increments ck_linenum.
  2166.  
  2167.        Return Value:  No value is returned.
  2168.  
  2169.        See Also:      s_printf, ck_s_puts, ck_s_putc, ck_linenum
  2170.  
  2171.        Example:       This example prints single CR/LF to local
  2172.                       and remote console.
  2173.  
  2174.        #include "ckit.h"
  2175.        main(int argc, char **argv) {
  2176.          if (argc > 1) {
  2177.            ck_open_door(argv[1]), argv[2]);
  2178.            .
  2179.            .
  2180.            .
  2181.            ck_newline();
  2182.            .
  2183.            .
  2184.            .
  2185.            ck_close_door();
  2186.          };
  2187.        };
  2188.  
  2189.  
  2190.                                                                  Functions
  2191.  
  2192.        ck_clear_row                             high level
  2193.        -------------------------------------------------------------------
  2194.        Summary:       #include "ckit.h"
  2195.                       void ck_clear_row(short);
  2196.  
  2197.        Description:   The clear_row function clears a given row on screen
  2198.                       of the local and remote console. (row = 1 - 24).
  2199.                       Used only if caller is in GRAPHICS or ansi_ng mode.
  2200.  
  2201.        Return Value:  No value is returned.
  2202.  
  2203.        See Also:      ck_clear_eol, ck_clr_screen.
  2204.  
  2205.        Example:       This example prints a string on a line, then
  2206.                       erases the string.
  2207.  
  2208.        #include ckit.h
  2209.        char prompt1 = "Enter filename to view: ";
  2210.        main(int argc, char **argv) {
  2211.          if (argc > 1) {
  2212.            ck_open_door(argv[1], argv[2]); (pass system file and port cmd)
  2213.            ck_pos_cursor(10, 1);
  2214.            ck_s_puts(prompt1);
  2215.            ck_pos_cursor(11, 1);
  2216.            ck_s_puts("Ready to clear above row, press a key");
  2217.            while(!(wait_keypress())) {
  2218.          };
  2219.          ck_clear_row(10);  /* clear row 10 */
  2220.          ck_newline();
  2221.          ck_close_door();
  2222.        };
  2223.  
  2224.  
  2225.                                                                  Functions
  2226.  
  2227.        ck_clear_eol                             high level
  2228.        -------------------------------------------------------------------
  2229.        Summary:       #include "ckit.h"
  2230.                       void ck_clear_eol(void);
  2231.  
  2232.        Description:   The clear_eol function clears to the end of line
  2233.                       from current cursor position.
  2234.                       Used only if caller is in GRAPHICS or ansi_ng mode.
  2235.  
  2236.        Return Value:  No value is returned.
  2237.  
  2238.        See Also:      ck_clear_eol, ck_clr_screen.
  2239.  
  2240.        Example:       This example clears to end of line on screen of
  2241.                       local and remote console.
  2242.  
  2243.        #include ckit.h
  2244.        char prompt1 = "Enter filename to view: ";
  2245.        main(int argc, char **argv) {
  2246.          if (argc > 1) {
  2247.            ck_open_door("c:\wildcat\callinfo.bbs", "PORT:03E8:5");
  2248.            ck_newline();
  2249.            ck_s_puts("Press a key to clear end of line below");
  2250.            ck_newline();
  2251.            ck_s_putv(prompt1, "\r", NULL);
  2252.            while(!(wait_keypress())) {
  2253.            };
  2254.            ck_clear_eol();
  2255.            ck_newline();
  2256.            ck_close_door();
  2257.          };
  2258.        };
  2259.  
  2260.  
  2261.                                                                  Functions
  2262.  
  2263.        ck_clr_screen                             high level
  2264.        -------------------------------------------------------------------
  2265.        Summary:       #include "ckit.h"
  2266.                       void ck_clr_screen(void);
  2267.  
  2268.        Description:   The clr_screen function clears entire screen of local
  2269.                        and remote console in either ASCII, GRAPHIC, or
  2270.                        ansi_ng mode.
  2271.  
  2272.        Return Value:  No value is returned.
  2273.  
  2274.        See Also:      ck_clear_screen.
  2275.  
  2276.        Example:       This example clears screen of local/remote console.
  2277.  
  2278.        #include ckit.h
  2279.        main(int argc, char **argv) {
  2280.          if (argc > 1) {
  2281.            ck_open_door(argv[1]);
  2282.            .
  2283.            .
  2284.            .
  2285.            ck_clr_screen();
  2286.            .
  2287.            .
  2288.            .
  2289.            ck_close_door();
  2290.          };
  2291.        };
  2292.  
  2293.                                                                  Functions
  2294.  
  2295.        ck_clear_screen                           high level
  2296.        -------------------------------------------------------------------
  2297.        Summary:       #include "ckit.h"
  2298.                       void ck_clear_screen(void);
  2299.  
  2300.        Description:   The clear_screen function clears entire screen of
  2301.                       local console including status line.
  2302.  
  2303.        Return Value:  No value is returned.
  2304.  
  2305.        See Also:      ck_clr_screen.
  2306.  
  2307.        Example:       This example clears screen of local console.
  2308.  
  2309.        #include ckit.h
  2310.        main(int argc, char **argv) {
  2311.          if (argc > 1) {
  2312.            ck_open_door(argv[1]);
  2313.            .
  2314.            .
  2315.            .
  2316.            ck_clear_screen();
  2317.            .
  2318.            .
  2319.            .
  2320.            ck_close_door();
  2321.          };
  2322.        };
  2323.  
  2324.  
  2325.                                                                  Functions
  2326.  
  2327.        ck_pos_cursor                             high level
  2328.        -------------------------------------------------------------------
  2329.        Summary:       #include "ckit.h"
  2330.                       void ck_pos_cursor(short, short);
  2331.  
  2332.        Description:   The pos_cursor function positions cursor at
  2333.                       row, column using ANSI. Caller must be in GRAPHICS,
  2334.                       or ansi_ng mode. If not no action will take place.
  2335.                       row = 1 to 25, column = 1 to 80.  C-KIT will not
  2336.                       let the local screen position cursor in status
  2337.                       line area.
  2338.  
  2339.        Return Value:  No value is returned.
  2340.  
  2341.        Example:       This example positions cursor at row 10, column 15
  2342.                       on the local/remote consoles.
  2343.  
  2344.        #include "ckit.h"
  2345.        short     row = 10;
  2346.        short     column = 15;
  2347.        main(int argc, char **argv) {
  2348.          if (argc > 1) {
  2349.            ck_open_door(argv[1]);
  2350.            .
  2351.            .
  2352.            .
  2353.            ck_pos_cursor(row, column);
  2354.            .
  2355.            .
  2356.            .
  2357.            ck_close_door();
  2358.          };
  2359.        };
  2360.  
  2361.                                                                  Functions
  2362.  
  2363.        ck_set_r_c                                high level
  2364.        -------------------------------------------------------------------
  2365.        Summary:       #include "ckit.h"
  2366.                       void ck_set_r_c(short, short);
  2367.  
  2368.        Description:   The set_r_c function positions cursor at
  2369.                       row, column using BIOS on the local screen.
  2370.                       row = 1 to 25 (23), column = 1 to 80.
  2371.                       C-KIT will not let the cursor be placed in the
  2372.                       status line area of local screen.
  2373.  
  2374.        Return Value:  No value is returned.
  2375.  
  2376.        Example:       This example positions cursor at row 5, column 1
  2377.                       on the local console.
  2378.  
  2379.        #include "ckit.h"
  2380.  
  2381.        short     row = 5;
  2382.        short     column = 1;
  2383.  
  2384.        main(int argc, char **argv) {
  2385.          if (argc > 1) {
  2386.            ck_open_door(argv[1]);
  2387.            .
  2388.            .
  2389.            .
  2390.            ck_set_r_c(row, column);
  2391.            .
  2392.            .
  2393.            .
  2394.            ck_close_door();
  2395.          };
  2396.        };
  2397.  
  2398.                                                                  Functions
  2399.  
  2400.        ck_back_space                             high level
  2401.        -------------------------------------------------------------------
  2402.        Summary:       #include "ckit.h"
  2403.                       void ck_back_space(short);
  2404.  
  2405.        Description:   The back_space function backspaces cursor short number
  2406.                       of spaces or to the 1st char in row, whichever is 1st.
  2407.                       This is a destrutive backspace.
  2408.  
  2409.        Return Value:  No value is returned.
  2410.  
  2411.        Example:       This example backspaces cursor over the prompt and
  2412.                       on the user's input local/remote consoles.
  2413.  
  2414.        #include ckit.h
  2415.  
  2416.        char prompt1 = "Enter filename to view: ";
  2417.  
  2418.        main(int argc, char **argv) {
  2419.          if (argc > 1) {
  2420.            ck_open_door("c:\pcb\pcboard.sys", "PORT:02E8:4");
  2421.            ck_s_puts("\r\nReady to test back_space()");
  2422.            ck_s_puts("Press a key when ready");
  2423.            ck_newline();
  2424.            while(!(wait_keypress())) {
  2425.          };
  2426.          ck_color(yellow);
  2427.          ck_s_puts(prompt1);
  2428.          ck_color(red);
  2429.          ck_get_cmdline();
  2430.          ck_back_space(strlen(prompt1) + strlen(cmdline));
  2431.          ck_close_door();
  2432.        };
  2433.  
  2434.  
  2435.                                                                  Functions
  2436.  
  2437.        ck_color                                  high level
  2438.        -------------------------------------------------------------------
  2439.        Summary:       #include "ckit.h"
  2440.                       void ck_color(short);
  2441.  
  2442.        Description:   The color function selects color to use using ANSI.
  2443.                       Caller must be in GRAPHICS mode.  If not, no action
  2444.                       is taken.  ck_color will only set the forground color
  2445.                       and leave the background color as it was.
  2446.  
  2447.        Return Value:  No value is returned.
  2448.  
  2449.        See Also:      Color macros above in macro section used with C-KIT
  2450.  
  2451.        Example:       This example sets color to red  on the local/remote
  2452.                       consoles.(see color macros in ckit.h)
  2453.  
  2454.            #include "ckit.h"
  2455.            main(int argc, char **argv) {
  2456.              if (argc > 1) {
  2457.                ck_open_door(argv[1]);
  2458.                .
  2459.                .
  2460.                .
  2461.                ck_color(red);
  2462.                .
  2463.                .
  2464.                .
  2465.                ck_close_door();
  2466.              };
  2467.            };
  2468.  
  2469.                                                                 Functions
  2470.  
  2471.        ck_set_ANSI                               high level
  2472.        -------------------------------------------------------------------
  2473.        Summary:       #include "ckit.h"
  2474.                       short  ck_set_ANSI(short)
  2475.  
  2476.        Description:   Allows manual program changing of ANSI capability.
  2477.                       Excepts either TRUE/FALSE.   Normally when C-kit
  2478.                       first opens a system file it determines from the file
  2479.                       whether the user wants ANSI control, (ansi_NG will
  2480.                       be set, GRAPHICS FALSE) OR if they wanted ANSI control
  2481.                       with graphics (ansi_NG false, GRAPHICS TRUE).  This
  2482.                       information is not available for generic.sys.
  2483.                       ck_set_ANSI allows people using the generic.sys file
  2484.                       to select ANSI control and/or ANSI control with
  2485.                       graphics.
  2486.  
  2487.        Return Value:  Returns whatever is passed to it.
  2488.  
  2489.        See Also:      ck_graphics, ck_ansi_ng
  2490.  
  2491.        Example:       This example turns on ANSI capability without
  2492.                       graphics.
  2493.  
  2494.            #include "ckit.h"
  2495.            main(int argc, char **argv) {
  2496.              if (argc > 1) {
  2497.                ck_open_door(argv[1]);
  2498.                .
  2499.                .
  2500.                .
  2501.                ansi_ng |= TRUE;  /* Set ansi_ng */
  2502.                graphics &= FALSE;
  2503.                .
  2504.                .
  2505.                .
  2506.                ck_set_ANSI(ansi_ng | graphics);
  2507.                .
  2508.                .
  2509.                .
  2510.                ck_close_door();
  2511.              };
  2512.            };
  2513.  
  2514.                                                                  Functions
  2515.  
  2516.        ck_get_cmdline                            high level
  2517.        -------------------------------------------------------------------
  2518.        Summary:       #include "ckit.h"
  2519.                       void ck_get_cmdline(void);
  2520.  
  2521.        Description:   Read a line of input (max 128 bytes). Echo to
  2522.                       screen, leave cursor after the last key typed before
  2523.                       C/R. Automatically checks for time_left, carrier.
  2524.                       Calls ck_input() and reads into array *cmdline,
  2525.                       automatically maps input to Uppercase.
  2526.                       Will also set key_source to source of input.
  2527.                       *defined in CKIT.H.  This function is the one
  2528.                       you would normally use for ALL user input.
  2529.                       ALL other input functions are intermediate or low
  2530.                       level functions.  Setting ck_DOTS = char will cause
  2531.                       char to be echoed to the remote/local console.
  2532.                       Filters all ASCII control charactors below 31 dec. out.
  2533.  
  2534.        Return Value:  No value is returned.
  2535.  
  2536.        See Also:      ck_input, ck_get_nextpar, ck_key_source, ck_wait_keypress
  2537.  
  2538.        Example:       This example reads keyboard  from local/remote
  2539.                       console into array get_cmdline[].  It also checks
  2540.                       for any scan_codes receieved.  See Ckitdemo.c also.
  2541.  
  2542.             #include "ckit.h"
  2543.             main(int argc, char **argv) {
  2544.             ck_open_door(argv[1]);
  2545.             do {
  2546.                 ck_newline();
  2547.                 display_time();
  2548.                 ck_color(green);
  2549.                 ck_s_puts("Command? ");
  2550.                 ck_get_cmdline();          /* read input into 'cmdline'  */
  2551.  
  2552.             } while((ck_DUMP_USER != TRUE) && (strlen(ck_cmdline) == 0) \
  2553.                    && (ck_scan_code == 0));
  2554.         }
  2555.         if (ck_DUMP_USER == TRUE) {
  2556.             ck_close_door();
  2557.             exit(1);
  2558.         }
  2559.         if (ck_scan_code != NULL) {
  2560.             ck_color(white);
  2561.             read_scancode();
  2562.             ck_newline();
  2563.         }
  2564.         if (ck_get_nextpar()) { /* scan next parameter from cmdline into par */
  2565.             ck_newline();
  2566.       /* process commands */
  2567.             switch ( par[0] ) {
  2568.                 case 'A':
  2569.                 ansi_demo();
  2570.                 break;
  2571.                 default:
  2572.                 ck_color(magenta);
  2573.                 ck_s_putv("(",par,") is not allowed!  Try again:", NULL);
  2574.                 *ck_cmdline = NULL;
  2575.             }
  2576.         }
  2577.  
  2578.  
  2579.                                                                  Functions
  2580.  
  2581.        ck_wait_keypress                          high level
  2582.        -------------------------------------------------------------------
  2583.        Summary:       #include "ckit.h"
  2584.                       short ck_wait_keypress(void);
  2585.  
  2586.        Description:   Waits for any keypress. Does not wait for a C/R.
  2587.                       Autochecks for CARRIER,  TIMEOUTS etc.
  2588.  
  2589.                       Returns ASCII code of key pressed or TRUE if
  2590.                       ck_DUMP_USER goes TRUE otherwise it will return FALSE.
  2591.                       Will also return TRUE if extended key is pressed.
  2592.                       Will not do so if a sysop function key is pressed.
  2593.                       Useful for "hot_key" applications. Will also set
  2594.                       key_source to proper value.
  2595.  
  2596.        Return Value:  ASCII code of keypressed or TRUE, FALSE
  2597.  
  2598.        See also: ck_check_CR, ck_check_keypress, ck_input, ck_get_cmdline
  2599.  
  2600.        Example:      This example will wait until a keypress or ck_DUMP_USER.
  2601.  
  2602.        #include "ckit.h"
  2603.  
  2604.        prompt2 = ""Press any key to continue";
  2605.  
  2606.        main(int argc, char **argv) {
  2607.          if (argc > 1) {
  2608.            ck_open_door(argv[1]);
  2609.            .
  2610.            .
  2611.            .
  2612.            ck_color(yellow);
  2613.            ck_newline();
  2614.            ck_s_puts(prompt2);
  2615.            while(!(ck_wait_keypress())) {
  2616.            };
  2617.            ck_back_space(strlen(prompt2) + 1);
  2618.            .
  2619.            .
  2620.            .
  2621.            ck_close_door();
  2622.          };
  2623.        };
  2624.  
  2625.  
  2626.                                                                  Functions
  2627.  
  2628.        ck_force_enter                            high level
  2629.        -------------------------------------------------------------------
  2630.        Summary:       #include "ckit.h"
  2631.                       void ck_force_enter(void);
  2632.  
  2633.        Description:   Prompts " Press Enter to continue: ", wait for C/R,
  2634.                       automatic carrier, time_left and sysop checks.
  2635.  
  2636.        Return Value:  NONE
  2637.  
  2638.        Example:       This example displays a string then prompts and
  2639.                       forces user to press C/R to continue.
  2640.  
  2641.        #include "ckit.h"
  2642.        main(int argc, char **argv) {
  2643.          if (argc > 1) {
  2644.            ck_open_door(argv[1]);
  2645.            .
  2646.            .
  2647.            .
  2648.            ck_color(yellow);
  2649.            ck_s_puts("Display this string\r\n");
  2650.            ck_force_enter();
  2651.            .
  2652.            .
  2653.            .
  2654.            ck_close_door();
  2655.          };
  2656.        };
  2657.  
  2658.  
  2659.                                                                  Functions
  2660.  
  2661.        display_time                              high level
  2662.        -------------------------------------------------------------------
  2663.        Summary:       #include "ckit.h"
  2664.                       void display_time(void);
  2665.  
  2666.        Description:   Displays (xxxx used, xxx left).
  2667.                       In CKIT2.0 and above, this function is not in
  2668.                       the library.  Instead, using the source code
  2669.                       below will do the same thing as previous
  2670.                       display_time().
  2671.  
  2672.        Return Value:  NONE
  2673.  
  2674.        See Also: mins_left_system(), system_time_used()
  2675.  
  2676.        Example:   See CKITDEMO.C also
  2677.  
  2678.        #include "ckit.h"
  2679.        main(int argc, char **argv) {
  2680.          ck_open_door(argv[1]);
  2681.          if (argc > 1) {
  2682.             ck_open_door(system_ptr, port_cmd_ptr);
  2683.             .
  2684.             .
  2685.             .
  2686.             display_time();
  2687.             .
  2688.             .
  2689.             .
  2690.        };
  2691.  
  2692.        void display_time(void) {
  2693.             color(yellow);
  2694.             ck_s_puts("(");
  2695.             ck_color(green);
  2696.             s_printf("%d used, ", system_time_used()+prev_used);
  2697.             ck_color(red);
  2698.             s_printf("%d left",  mins_left_system()+time_credit);
  2699.             ck_color(yellow);
  2700.             ck_s_puts(") ");
  2701.        }
  2702.  
  2703.  
  2704.                                                                  Functions
  2705.  
  2706.        ck_get_cmdline_raw                        high level
  2707.        -------------------------------------------------------------------
  2708.        Summary:       #include "ckit.h"
  2709.                       void ck_get_cmdlinaw(short);
  2710.  
  2711.        Description:   Same as get_cmdline() above but erases prompt of
  2712.                       after input and user input also.  Expects length
  2713.                       of prompt to be passed to it.
  2714.  
  2715.        Return Value:  No value is returned.
  2716.  
  2717.        See Also:      ck_get_cmdline, ck_get_nextpar, ck_get_cmdline, ck_input
  2718.  
  2719.        Example:       This example reads keyboard  from local/remote
  2720.                       console into array cmdline[], (filename), then
  2721.                       displays file.
  2722.  
  2723.        #include "ckit.h"
  2724.  
  2725.        char prompt1 = "Enter filename to display: ";
  2726.  
  2727.        main(int argc, char **argv) {
  2728.          if (argc > 1) {
  2729.            ck_open_door(argv[1]);
  2730.            ck_s_puts(prompt1);
  2731.            ck_get_cmdline_raw(strlen(prompt1));
  2732.            ck_newline();
  2733.            ck_display_file(cmdline);
  2734.            ck_close_door();
  2735.          };
  2736.        };
  2737.  
  2738.  
  2739.                                                                  Functions
  2740.  
  2741.        ck_get_nextpar                            high level
  2742.        -------------------------------------------------------------------
  2743.        Summary:       #include "ckit.h"
  2744.                       char ck_get_nextpar(void);
  2745.  
  2746.        Description:   Scans next stacked command from cmdline[] array
  2747.                       into "par[]".  par defined in CKIT.H
  2748.  
  2749.        Return Value:  Returns 0 if none available, non-zero if cmd available
  2750.  
  2751.        See Also:      input, get_cmdline, cmdline and par in GLOBAL section.
  2752.  
  2753.        Example:       This example reads keyboard  from local/remote
  2754.                       console into array get_cmdline[], then calls
  2755.                       get_nextpar to scan for cmds entered.
  2756.  
  2757.      #include "ckit.h"
  2758.  
  2759.      main(int argc, char **argv) {
  2760.        if (argc > 1) {
  2761.          ck_open_door(argv[1]);
  2762.          do {
  2763.             ck_get_cmdline();    /* read input into 'cmdline'  */
  2764.          } while( (ck_DUMP_USER != TRUE) && ( strlen(cmdline) == 0 ));
  2765.          if (ck_get_nextpar()) { /* scan next parameter from cmdline into par */
  2766.          /* process commands */
  2767.             switch ( ck_par[0] ) {
  2768.                 case 'A':
  2769.                 ansi_demo();
  2770.                 break;
  2771.                 default:
  2772.                 break;
  2773.             };
  2774.          };
  2775.        };
  2776.       ck_close_door();
  2777.      };
  2778.  
  2779.                                                                  Functions
  2780.  
  2781.        ck_nomore                                 high level
  2782.        -------------------------------------------------------------------
  2783.        Summary:       #include "ckit.h"
  2784.                       short ck_nomore(void);
  2785.  
  2786.        Description:   Displays prompt:
  2787.                       "More: (Enter) or (Y)es, (N)o, (NS)nonstop? ".
  2788.                        Returns 0 = Non_stop
  2789.                                1 = Yes
  2790.                                2 = No
  2791.  
  2792.                       Also checks for CTRL K.
  2793.                       The "More:" prompt will be yellow,
  2794.                       the rest will be green.
  2795.  
  2796.        Return Value: short value, meaning described above/
  2797.  
  2798.        See Also:      ck_get_def, ck_get_defyn, ck_get_defen
  2799.  
  2800.        Example:       This example loops 3 times to show what each
  2801.                       keypress (N,Y or NS) returns.
  2802.        #include "ckit.h"
  2803.  
  2804.        short      result, i;
  2805.  
  2806.        main(int argc, char **argv) {
  2807.          if (argc > 1) {
  2808.            ck_open_door(argv[1]);
  2809.            for(i=0; i <= 2; i++) {
  2810.              ck_s_puts("\r\nReady to test NOMORE 3 times");
  2811.              ck_newline();
  2812.              while(!(ck_wait_keypress())) {
  2813.              };
  2814.              result = ck_nomore();
  2815.              printf("Nomore() returned  %d", result);
  2816.              ck_newline();
  2817.           };
  2818.        ck_close_door();
  2819.        };
  2820.  
  2821.                                                                  Functions
  2822.  
  2823.        ck_get_defyn                              high level
  2824.        -------------------------------------------------------------------
  2825.        Summary:       #include "ckit.h"
  2826.                       void ck_get_defyn(char *, short)
  2827.  
  2828.        Description:   Displays prompt string and either
  2829.                       "Enter=yes " or "Enter=no" based on short value.
  2830.                       1st prompt will be yellow, default will be green.
  2831.                       If short is Non_zero it will display "Enter=Yes".
  2832.                       If short is Zero (NULL) it will display "Enter=No".
  2833.                       Calls get_cmdline for user input.
  2834.  
  2835.        Return Value:  None
  2836.  
  2837.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2838.  
  2839.        Example:       This example loops 2 times to show what each
  2840.                       value or i displays.
  2841.        #include "ckit.h"
  2842.  
  2843.        short i;
  2844.  
  2845.        main(int argc, char **argv) {
  2846.          if (argc > 1) {
  2847.            ck_open_door(argv[1]);
  2848.            for(i=0; i <= 1; i++) {
  2849.              ck_s_puts("\r\nReady to test get_defyn()");
  2850.              ck_newline();
  2851.              ck_get_defyn("Continue? ", i);
  2852.              ck_s_putv("You entered ", cmdline, NULL);
  2853.              ck_newline();
  2854.           };
  2855.        ck_close_door();
  2856.        };
  2857.  
  2858.                                                                  Functions
  2859.  
  2860.        ck_get_defen                              high level
  2861.        -------------------------------------------------------------------
  2862.        Summary:       #include "ckit.h"
  2863.                       void ck_get_defen(char *)
  2864.  
  2865.        Description:   Same as get_defyn except the default string
  2866.                       "(Enter=none?) " will be appended.
  2867.                       1st prompt will be yellow, default will be green.
  2868.                       Calls get_cmdline for user input.
  2869.  
  2870.        Return Value:  None
  2871.  
  2872.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2873.  
  2874.        Example:
  2875.  
  2876.        #include "ckit.h"
  2877.  
  2878.        main(int argc, char **argv) {
  2879.          if (argc > 1) {
  2880.            ck_open_door(argv[1]);
  2881.            ck_s_puts("\r\nReady to test get_defne()");
  2882.            ck_newline();
  2883.            ck_get_defne("Enter filename? ");
  2884.            ck_s_putv("You entered ", cmdline, NULL);
  2885.            ck_newline();
  2886.        ck_close_door();
  2887.        };
  2888.  
  2889.                                                                  Functions
  2890.  
  2891.        ck_getdef                                 high level
  2892.        -------------------------------------------------------------------
  2893.        Summary:       #include "ckit.h"
  2894.                       void   ck_get_def(char *, char *)
  2895.  
  2896.        Description:   Same as get_defen except both colored prompts
  2897.                       are user defineable.  The 1st prompt will be
  2898.                       yellow, the 2nd one green.
  2899.                       Calls get_cmdline for user input.
  2900.        Return Value:  None
  2901.  
  2902.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2903.  
  2904.        Example:       Print 2 prompts, and print user input.
  2905.  
  2906.        static  char prompt1 = "Enter filename? "
  2907.        static  char prompt2 = "(Enter = quit)";
  2908.  
  2909.        #include "ckit.h"
  2910.  
  2911.        main(int argc, char **argv) {
  2912.          if (argc > 1) {
  2913.            ck_open_door(argv[1]);
  2914.            ck_s_puts("\r\nReady to test get_def()");
  2915.            ck_newline();
  2916.            ck_get_def(prompt1, prompt2);
  2917.            ck_s_putv("You entered ", cmdline, NULL);
  2918.            ck_newline();
  2919.        ck_close_door();
  2920.        };
  2921.  
  2922.                                                                  Functions
  2923.  
  2924.        ck_prompt_def                             high level
  2925.        -------------------------------------------------------------------
  2926.        Summary:       #include "ckit.h"
  2927.                       void ck_prompt_def(char *, char *)
  2928.  
  2929.        Description:   Same as get_def except it does not call
  2930.                       get_cmdline. 1st prompt will be yellow,
  2931.                       2nd prompt green.
  2932.  
  2933.        Return Value:  None
  2934.  
  2935.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2936.  
  2937.        Example:       Print 2 prompts.
  2938.  
  2939.        static  char prompt1 = "Enter filename? "
  2940.        static  char prompt2 = "(Enter = quit)";
  2941.  
  2942.        #include "ckit.h"
  2943.  
  2944.        main(int argc, char **argv) {
  2945.          if (argc > 1) {
  2946.            ck_open_door(argv[1]);
  2947.            ck_s_puts("\r\nReady to test prompt_def()");
  2948.            ck_newline();
  2949.            ck_prompt_def(prompt1, prompt2);
  2950.            ck_get_cmdline();
  2951.            ck_newline();
  2952.        ck_close_door();
  2953.        };
  2954.  
  2955.                                                                  Functions
  2956.  
  2957.        ck_getdefn                                high level
  2958.        -------------------------------------------------------------------
  2959.        Summary:       #include "ckit.h"
  2960.                       void   ck_get_defn(char *, char *)
  2961.  
  2962.        Description:   Same as get_def except appends "Enter=none" to end.
  2963.                       Calls get_cmdline for user input.
  2964.  
  2965.        Return Value:  None
  2966.  
  2967.        See Also:      ck_cmd_line, ck_get_def, ck_get_defyn, ck_get_defen
  2968.  
  2969.  
  2970.                                                                  Functions
  2971.  
  2972.        ck_dos_shell                              high level
  2973.        -------------------------------------------------------------------
  2974.        Summary:       #include "ckit.h"
  2975.                       short ck_dos_shell(char *, char *);
  2976.  
  2977.        Description:   Will execute program pointed arg1, arg2 is passed
  2978.                       as command line arguments to the program.
  2979.                       arg2 must be < 128 chars. (DOS limit).
  2980.                       This function uses spawnlp() to execute the program.
  2981.                       If you plan on doing any shells, you need to use this
  2982.                       function since it will disable the keyboard timer
  2983.                       while the shell is taking place and perform some other
  2984.                       clean up's upon re-entry.  This call uses C's
  2985.                       spawnlp() function, as P_WAIT.
  2986.  
  2987.        Return Value:  -1 = error (check 'C's GLOBAL _errno), NULL = NO error
  2988.  
  2989.        See also: F5 local shell to DOS, and CKITDEMO.C
  2990.  
  2991.        Example:  Download a file using Zmodem taken from CKITDEMO.C
  2992.  
  2993.    #include "ckit.h"
  2994.  
  2995.    char    zmodem_cmds[128];     /* Buffer to build Zmodem command   */
  2996.  
  2997.    main(int argc, char **argv) {
  2998.      if (argc > 1) {
  2999.        ck_open_door(argv[1]);
  3000.        .
  3001.        .
  3002.        .
  3003.     color(green);
  3004.     s_printf("\nReady to send %s. Press <ENTER> to begin.",doc_filename);
  3005.     while(DUMP_USER != TRUE) {
  3006.           if( check_CR() ) {
  3007.             break;
  3008.         }
  3009.     }
  3010.    sprintf(zmodem_cmds, "portx %X,%X pB4096 pa3000 handshake cts sz %s", \
  3011.             uart_base, irq, doc_filename);
  3012.     if(dos_shell("dsz", zmodem_cmds)) {
  3013.         s_puts("\n\aTransfer aborted");
  3014.     } else {
  3015.         s_puts("\nTransfer complete");
  3016.     }
  3017.        .
  3018.        .
  3019.        .
  3020.        ck_close_door();
  3021.      };
  3022.    };
  3023.  
  3024.  
  3025.                                                                  Functions
  3026.  
  3027.        ck_display_file                           high level
  3028.        -------------------------------------------------------------------
  3029.        Summary:      #include "ckit.h"
  3030.                      short ck_display_file(char *);
  3031.  
  3032.        Description:  Displays file to local/remote consoles.  Automatic
  3033.                      use of page_length, control K checks, MORE? prompting,
  3034.                      closes file when done. Expects a pointer to name/path
  3035.                      of file to display.  If page_length is 0, the
  3036.                      MORE? prompting will be disabled.  You can use this
  3037.                      to your advantage for files that you do not want
  3038.                      MORE? prompting by setting ck_userpage_length to 0 before
  3039.                      calling display_file().  Just make sure you save the
  3040.                      original value of ck_userpage_length if you need it later
  3041.                      on. This function will not automatically attempt to
  3042.                      display a graphic file if the user is in graphics.
  3043.                      For display non-interruptable menus, set page_length
  3044.                      to NULL before calling this function.
  3045.                      It is up to the door author to decide how he wants
  3046.                      to handle it. see below.  This call is done to
  3047.                      the Borland _open() or MSC _dos_open() libraries as
  3048.                      _open(filename, O_RDONLY | O_DENYNONE);
  3049.                      (share compatible mode)
  3050.  
  3051.        Return Value: Returns  non-zero if error.  If desired, you can then
  3052.                      check the C global _errno for the cause of the problem.
  3053.  
  3054.        See Also:     NONE
  3055.  
  3056.        Example:      This example displays the file ckit.m, then forces
  3057.                      user to press enter when done.
  3058.  
  3059.        #include "ckit.h"
  3060.        main(int argc, char **argv) {
  3061.          if (argc > 1) {
  3062.            ck_open_door(argv[1]);
  3063.            .
  3064.            .
  3065.            .
  3066.            strcpy(filename, "ckit.m")
  3067.            if(!ck_graphics) {
  3068.                (ck_display_file(filename);
  3069.             } else {
  3070.                 strcat(filename,"g");
  3071.                (ck_display_file(filename);
  3072.             }
  3073.            ck_force_enter();
  3074.            .
  3075.            .
  3076.            .
  3077.          };
  3078.          ck_close_door();
  3079.        };
  3080.  
  3081.                                                                  Functions
  3082.  
  3083.        ck_debug_on                               high level
  3084.        -------------------------------------------------------------------
  3085.        Summary:       #include "ckit.h"
  3086.                       void ck_debug_on(void); alias ck_carrier_on();
  3087.  
  3088.        Description:   A call to this function while debugging your door
  3089.                       will disable the keyboard timer among other things
  3090.                       while you are trying to debug your door.  Make
  3091.                       sure you remove this call before releasing your door
  3092.                       or the keyboard timeout will not function!  It should
  3093.                       only be called after open_door();.  This can also
  3094.                       be used if needed to use transmit_modem() while the
  3095.                       door is opened. This will disable ck_DUMP_USER from
  3096.                       going true.  Make sure you turn debug back on!
  3097.                       using debug_off();
  3098.  
  3099.        Return Value:  NONE
  3100.  
  3101.  
  3102.        Example:
  3103.  
  3104.        #include "ckit.h"
  3105.        main(int argc, char **argv) {
  3106.          if (argc > 1) {
  3107.            ck_open_door(argv[1]);
  3108.            .
  3109.            .
  3110.            .
  3111.            ck_debug_on();
  3112.            ck_lower_dtr();    /* Drop user off           */
  3113.            ck_raise_dtr();
  3114.            ck_wait(1);        /* wait for modem to reset */
  3115.            ck_flush_RQUEUE(); /* Flush receive queue     */
  3116.            ck_transmit_modem("ATDT6159826537");
  3117.            ck_debug_off();
  3118.            while(ck_tqueue_len()); /* wait on modem */
  3119.            ck_newline();
  3120.            delay(1);
  3121.            while(ck_DUMP_USER != TRUE) { /* wait for modem */
  3122.              ck_get_cmdline();
  3123.              ck_newline();
  3124.              ck_s_putv("Modem returned -> ",cmdline, NULL);
  3125.              break;
  3126.            };
  3127.            .
  3128.            .
  3129.            .
  3130.          };
  3131.          ck_close_door();
  3132.        };
  3133.  
  3134.  
  3135.                                                                  Functions
  3136.  
  3137.        ck_debug_off                              high level
  3138.        -------------------------------------------------------------------
  3139.        Summary:       #include "ckit.h"
  3140.                       void ck_debug_on(void); alias ck_carrier_off();
  3141.  
  3142.        Description:   After a call to debug_on(), this will re-enable
  3143.                       keyboard timer, etc.
  3144.                       It should only be called after open_door();
  3145.  
  3146.        Return Value:  NONE
  3147.  
  3148.  
  3149.        Example:
  3150.  
  3151.        #include "ckit.h"
  3152.        main(int argc, char **argv) {
  3153.          if (argc > 1) {
  3154.            ck_open_door(argv[1]);
  3155.            ck_debug_on();  /* while debugging door */
  3156.            .
  3157.            .
  3158.            .
  3159.          };
  3160.          ck_debug_off();
  3161.          ck_close_door();
  3162.        };
  3163.  
  3164.  
  3165.  
  3166.                                                                  Functions
  3167.  
  3168.        ck_input                                  intermediate level
  3169.        -------------------------------------------------------------------
  3170.        Summary:       #include "ckit.h"
  3171.                       void ck_input(BYTE *, short);
  3172.  
  3173.        Description:   Read a line of input with specified length. Echo to
  3174.                       screen, leave cursor after the last key typed before
  3175.                       C/R. Automatically checks for time_left, carrier.
  3176.                       Expects a char array pointer to store input and max.
  3177.                       length of input to read.  NOTE: Each call to input()
  3178.                       will purge the buffer in use to NULLS.  MAX length
  3179.                       must not exceed the size of your array and it must
  3180.                       not include the NULL char. (sizeof(array) - 1).
  3181.                       It will also set key_source = 1 or 2. Setting
  3182.                       ck_DOTS = char will cause char to be echoed to the
  3183.                       local/remote consoles.
  3184.  
  3185.        Return Value:  No value is returned.
  3186.  
  3187.        See Also:      ck_get_cmdline(), ck_inkey(), ck_getkey(), ck_key_source
  3188.                       ck_wait_keypress(), ck_check_CTRL_K
  3189.  
  3190.        Example:       This example reads keyboard input from local/remote
  3191.                       console into array usr_input[] with max. bytes to
  3192.                       read equal to 100 bytes. Will set key_source
  3193.                       equal to source of input.
  3194.  
  3195.        NOTE:          This a "intermediate" level function.  You would not
  3196.                       normally need to use this function.  get_cmdline();
  3197.                       would normally be used and will handle all input
  3198.                       for you.
  3199.  
  3200.  
  3201.        #include "ckit.h"
  3202.        main(int argc, char **argv) {
  3203.          if (argc > 1) {
  3204.            ck_open_door(argv[1]);
  3205.            .
  3206.            .
  3207.            .
  3208.            ck_input(&usr_input[0], sizeof(usr_input) - 1);
  3209.            .
  3210.            .
  3211.            .
  3212.            ck_close_door();
  3213.          };
  3214.        };
  3215.  
  3216.                                                                  Functions
  3217.  
  3218.        ck_check_time_left                        intermediate level
  3219.        -------------------------------------------------------------------
  3220.        Summary:       #include "ckit.h"
  3221.                       void ck_check_time_left(void);
  3222.  
  3223.        Description:   Checks time left on system, automatically sets
  3224.                       ck_DUMP_USER if time expired.  Should be included
  3225.                       in all major program loops if you are going to use it.
  3226.  
  3227.        Return Value:  NONE
  3228.  
  3229.        See Also:      display_time, ck_get_cmdline
  3230.  
  3231.        Example:       This function is normally handled by get_cmdline()
  3232.                       and input().  You do not normally need to use it.
  3233.  
  3234.        #include "ckit.h"
  3235.  
  3236.        main(int argc, char **argv) {
  3237.          if (argc > 1) {
  3238.            ck_open_door(argv[1]);
  3239.            .
  3240.            .
  3241.            .
  3242.            ck_check_time_left();
  3243.            if(ck_DUMP_USER == TRUE) {
  3244.              ck_close_door();
  3245.            };
  3246.            .
  3247.            .
  3248.            .
  3249.            ck_close_door();
  3250.          };
  3251.        };
  3252.  
  3253.        ck_mins_left_system                       intermediate level
  3254.        -------------------------------------------------------------------
  3255.        Summary:       #include "ckit.h"
  3256.                       short ck_mins_left_system(void);
  3257.  
  3258.        Description:   Returns the time left in the door, not including
  3259.                       any time_credit given.  Does not set ck_DUMP_USER.
  3260.                       If expired, the time returned will be 0 or
  3261.                       negative minutes.  Does not include any time
  3262.                       credit given in door.
  3263.  
  3264.        Return Value:  short value - minutes remaining in door
  3265.  
  3266.        See Also:      display_time, ck_get_cmdline, time_credit
  3267.  
  3268.        Example:
  3269.  
  3270.        #include "ckit.h"
  3271.  
  3272.        minutes_left;
  3273.        main(int argc, char **argv) {
  3274.          if (argc > 1) {
  3275.            ck_open_door(argv[1]);
  3276.            .
  3277.            .
  3278.            .
  3279.            color(yellow);
  3280.            s_puts("(");
  3281.            color(green);
  3282.            s_printf("%d used, ", system_time_used()+prev_used);
  3283.            color(red);
  3284.            s_printf("%d left",  mins_left_system()+time_credit);
  3285.            color(yellow);
  3286.            s_puts(") ");
  3287.            .
  3288.            .
  3289.            .
  3290.            ck_close_door();
  3291.          };
  3292.        };
  3293.  
  3294.        ck_system_time_used                       intermediate level
  3295.        -------------------------------------------------------------------
  3296.        Summary:       #include "ckit.h"
  3297.                       short ck_system_time_used(void);
  3298.  
  3299.        Description:   Returns the time used in minutes since the
  3300.                       door was opened. Does not set ck_DUMP_USER.
  3301.                       Does not include time prev used in door.
  3302.  
  3303.        Return Value:  short value - minutes used since door opened.
  3304.  
  3305.        See Also:      display_time, prev_used
  3306.  
  3307.        Example:
  3308.  
  3309.        #include "ckit.h"
  3310.  
  3311.        minutes_left;
  3312.        main(int argc, char **argv) {
  3313.          if (argc > 1) {
  3314.            ck_open_door(argv[1]);
  3315.            .
  3316.            .
  3317.            .
  3318.            color(yellow);
  3319.            s_puts("(");
  3320.            color(green);
  3321.            s_printf("%d used, ", system_time_used()+prev_used);
  3322.            color(red);
  3323.            s_printf("%d left",  mins_left_system()+time_credit);
  3324.            color(yellow);
  3325.            s_puts(") ");
  3326.            .
  3327.            .
  3328.            .
  3329.            ck_close_door();
  3330.          };
  3331.        };
  3332.  
  3333.                                                                  Functions
  3334.  
  3335.        ck_adjust_time_allowed                    intermediate level
  3336.        -------------------------------------------------------------------
  3337.        Summary:       #include "ckit.h"
  3338.                       void ck_adjust_time_allowed(short);
  3339.  
  3340.        Description:   Adjust user time left on system. Automatically
  3341.                       updates PCBoard.sys to reflect change.
  3342.                       This function will only be effective on systems
  3343.                       using pcboard.sys.
  3344.  
  3345.        Return Value:  NONE
  3346.  
  3347.        See Also:      
  3348.  
  3349.        Example:  For complete example see CKITDEMO.C included
  3350.  
  3351.        if (ck_get_nextpar()) {  /* scan next parameter from cmdline into par */
  3352.         if (!strcmpi(thinking_of, par)) {
  3353.             ck_color(green);
  3354.             ck_s_puts("That's right!  You get a 10 minute bonus!");
  3355.             ck_adjust_time_allowed(10);
  3356.         } else {
  3357.            ck_color(blue);
  3358.            ck_s_putv("Wrong! You lose 2 minutes! \
  3359.                    I was thinking of ", thinking_of,".",NULL);
  3360.                   adjust_time_allowed(-2);
  3361.         }
  3362.       }
  3363.  
  3364.  
  3365.                                                                  Functions
  3366.  
  3367.        ck_check_event                            intermediate level
  3368.        -------------------------------------------------------------------
  3369.        Summary:       #include "ckit.h"
  3370.                       short ck_check_event(void);
  3371.  
  3372.        Description:   Checks if time left will conflict with event.
  3373.  
  3374.        Return Value:  0 if no conflict, otherwise it will return the
  3375.                       minutes left before event.
  3376.  
  3377.  
  3378.        See Also:      ck_event_minutes, ck_mins_before_event.
  3379.  
  3380.        EXAMPLE:      C-KIT will automatically check for event conflicts.
  3381.                      This function would normally not be used.
  3382.  
  3383.  
  3384.  
  3385.                                                                  Functions
  3386.  
  3387.        ck_event_minutes                          intermediate level
  3388.        -------------------------------------------------------------------
  3389.        Summary:       #include "ckit.h"
  3390.                       short ck_event_minutes(void);
  3391.  
  3392.        Description:   Checks minutes past midnight event is scheduled.
  3393.                       This function is normally handled by C-KIT.
  3394.                       This function would normally not be used.
  3395.  
  3396.        Return Value:  Number of minutes past midnight event is scheduled
  3397.                       to run.
  3398.  
  3399.        See Also:      ck_check_event, ck_mins_before_event.
  3400.  
  3401.        #include "ckit.h"
  3402.  
  3403.        main(int argc, char **argv) {
  3404.          if (argc > 1) {
  3405.            ck_open_door(argv[1]);
  3406.            .
  3407.            .
  3408.            .
  3409.            ck_short   event_mins;
  3410.            ck_event_mins = event_minutes();
  3411.            .
  3412.            .
  3413.            .
  3414.            ck_close_door();
  3415.          };
  3416.        };
  3417.  
  3418.  
  3419.  
  3420.                                                                  Functions
  3421.  
  3422.        ck_mins_before_event                      intermediate level
  3423.        -------------------------------------------------------------------
  3424.        Summary:       #include "ckit.h"
  3425.                       short ck_mins_before_event(void);
  3426.  
  3427.        Description:   Check minutes left before event from current time.
  3428.  
  3429.        Return Value:  Minutes before event from current time.
  3430.  
  3431.        See Also:      ck_check_event, ck_event_minutes.
  3432.  
  3433.        Example:
  3434.  
  3435.        #include "ckit.h"
  3436.  
  3437.        main(int argc, char **argv) {
  3438.          if (argc > 1) {
  3439.            ck_open_door(argv[1]);
  3440.            .
  3441.            .
  3442.            .
  3443.            short  mins_before_event;
  3444.            mins_before_event = ck_mins_before_event();
  3445.            .
  3446.            .
  3447.            .
  3448.            ck_close_door();
  3449.          };
  3450.        };
  3451.  
  3452.  
  3453.                                                                  Functions
  3454.  
  3455.        ck_delay                                  intermediate level
  3456.        -------------------------------------------------------------------
  3457.        Summary:       #include "ckit.h"
  3458.                       void ck_delay(short);
  3459.  
  3460.        Description:   General purpose delay in milliseconds
  3461.                       Minumum of 55 ms.  (short must be >= 1)
  3462.                       This function is good only on the MSC librarys.
  3463.                       The TURBO librarys use Borland's DELAY() function.
  3464.  
  3465.        See also:      ck_wait
  3466.  
  3467.        Return Value:  NONE
  3468.  
  3469.  
  3470.  
  3471.  
  3472.                                                                  Functions
  3473.  
  3474.        ck_wait                                   intermediate level
  3475.        -------------------------------------------------------------------
  3476.        Summary:       #include "ckit.h"
  3477.                       void ck_wait(short);
  3478.  
  3479.        Description:   General purpose delay in seconds
  3480.                       Minumum of 1 sec. for now  (short must be >= 1)
  3481.                       less than one will result in 1/2 second delay.
  3482.                       Use ck_delay above
  3483.  
  3484.  
  3485.        Return Value:  NONE
  3486.  
  3487.        See also:      ck_delay
  3488.  
  3489.  
  3490.  
  3491.                                                                  Functions
  3492.  
  3493.        ck_purge_buffer                           intermediate level
  3494.        -------------------------------------------------------------------
  3495.        Summary:       #include "ckit.h"
  3496.                       void ck_purge_buffer(BYTE *, short);
  3497.  
  3498.        Description:   purge_buffer will purge any buffer to NULLS by
  3499.                       passing a pointer to the buffer and the size of the
  3500.                       buffer. i.e purge_buffer(buffer, 0x80).
  3501.                       This may or may not be useful but is available.
  3502.  
  3503.            NOTE: There is a seperate purge function for the serial port
  3504.            input buffer if you wish to purge it before calling input.
  3505.            See flush_RQUEUE.
  3506.  
  3507.        Return Value:  NONE
  3508.  
  3509.        See also: flush_RQUEUE
  3510.  
  3511.        Example:
  3512.  
  3513.        #include "ckit.h"
  3514.  
  3515.        static BYTE buff[256] = "This is purge buffer test";
  3516.  
  3517.        main(int argc, char **argv) {
  3518.          if (argc > 1) {
  3519.            ck_open_door(argv[1]);
  3520.            .
  3521.            .
  3522.            .
  3523.            ck_purge_buffer(buff, 255);
  3524.            .
  3525.            .
  3526.            .
  3527.            ck_close_door();
  3528.          };
  3529.        };
  3530.  
  3531.  
  3532.  
  3533.                                                                  Functions
  3534.  
  3535.        ck_check_CR                               intermediate level
  3536.        -------------------------------------------------------------------
  3537.        Summary:       #include "ckit.h"
  3538.                       void short ck_check_CR(void);
  3539.  
  3540.        Description:   Check for a carriage return, does not wait, does
  3541.                       not display any prompts.
  3542.                       Returns TRUE or FALSE
  3543.  
  3544.        Return Value:  TRUE, FALSE
  3545.  
  3546.        See also: ck_force_enter(), ck_get_cmdline(), ck_check_keypress()
  3547.  
  3548.  
  3549.  
  3550.                                                                  Functions
  3551.  
  3552.        ck_check_CTRL_K                           intermediate level
  3553.        -------------------------------------------------------------------
  3554.        Summary:       #include "ckit.h"
  3555.                       short ck_check_CTRL_K(void);
  3556.  
  3557.        Description:   Check if a CONTROL K (ASCII 11) has been entered.
  3558.                       Returns TRUE or FALSE
  3559.  
  3560.        Return Value:  TRUE, FALSE
  3561.  
  3562.        See also: ck_CtrlK_OFF, ck_CtrlK_ON
  3563.  
  3564.  
  3565.                                                                  Functions
  3566.  
  3567.        ck_CtrlK_ON                               intermediate level
  3568.        -------------------------------------------------------------------
  3569.        Summary:       #include "ckit.h"
  3570.                       void CtrlK_ON(void);
  3571.  
  3572.        Description:   Enables  CONTROL K (ASCII 11) checking.
  3573.                       This is normally off since most menu types are
  3574.                       non_interruptable.  If turned on, CTRL K will
  3575.                       be recognized.  Once on, you must call CtrlK_OFF()
  3576.                       (see below) to disable it.  CTRL K's are also NOT
  3577.                       put into the input buffer.  You have to use the
  3578.                       check_CTRL_K() function (see above) to determine
  3579.                       if a CTRL K has been pressed.
  3580.  
  3581.        See also:  ck_CtrlK_OFF, ck_check_CTRL_K()
  3582.  
  3583.                                                                  Functions
  3584.  
  3585.        ck_CtrlK_OFF                              intermediate level
  3586.        -------------------------------------------------------------------
  3587.        Summary:       #include "ckit.h"
  3588.                       void ck_CtrlK_OFF(void);
  3589.  
  3590.        Description:   Disables CONTROL K (ASCII 11) checking.
  3591.  
  3592.        See also: ck_CtrlK_ON, ck_check_CTRL_K()
  3593.  
  3594.  
  3595.        ck_set_kybd_time                       intermediate level
  3596.        -------------------------------------------------------------------
  3597.        Summary:       #include "ckit.h"
  3598.                       void ck_set_kybd_time(BYTE, BYTE);
  3599.  
  3600.        Description:   Sets keyboard timer to desired values.
  3601.                       Default is 2 minutes beep and 5 minute timeout.
  3602.  
  3603.         This allows the door author to set the keyboard timer.  The
  3604.         time has a resolution in minutes, with a minimum of 1 minute
  3605.         and a maximum of 255.  The routine expects two numbers.  The
  3606.         first number is the BEEP time.  This sets how many minutes
  3607.         should pass before the keyboard timer gives a warning beep.
  3608.         It will continue to beep afterwards at one  minute intervals.
  3609.         The second number is the actual keyboard timeout value.  It
  3610.         should normally be set to some number higher than the BEEP time.
  3611.         NOTE: Each call to ck_set_kybd_time() will reset the current
  3612.         keyboard timer to zero.
  3613.  
  3614.         Example: Set the BEEP time to 2 minutes and timeout to 6 minutes.
  3615.  
  3616.        #include "ckit.h"
  3617.  
  3618.        main(int argc, char **argv) {
  3619.          if (argc > 1) {
  3620.            ck_open_door(argv[1]);
  3621.            .
  3622.            .
  3623.            .
  3624.            ck_set_kybd_time(2, 6);
  3625.            .
  3626.            .
  3627.            .
  3628.            ck_close_door();
  3629.          };
  3630.        };
  3631.  
  3632.  
  3633.                                                                  Functions
  3634.  
  3635.         NOTE:  ALL the low level functions below are not normally
  3636.                needed and are handled automatically by C-KIT in a
  3637.                higher level function.  Most of these functions
  3638.                do NO carrier detects, etc.  They are only provided
  3639.                in special cases that may need them.  Use with caution.
  3640.  
  3641.        ck_inkey                                  low level
  3642.        -------------------------------------------------------------------
  3643.        Summary:       #include "ckit.h"
  3644.                       BYTE ck_inkey(void);
  3645.  
  3646.        Description:   Read character (if available) from local/remote
  3647.                       console.  Does not wait for input.  Also sets
  3648.                       key_source equal to SYSOP or USER_KEY.  Inkey
  3649.                       will also keep track of time left and set ck_DUMP_USER
  3650.                       if time expires.
  3651.  
  3652.        Return Value:  Returns 0 if none available, otherwise returns key
  3653.                       pressed
  3654.  
  3655.        See Also:      input, sio_getbyte, key_source above in globals,
  3656.                       check_CTRL_K
  3657.  
  3658.        Example:       This example checks for A at the keyboard,
  3659.                       from local/remote console, returns TRUE or FALSE
  3660.  
  3661.        #include "ckit.h"
  3662.  
  3663.        main(int argc, char **argv) {
  3664.          if (argc > 1) {
  3665.            ck_open_door(argv[1]);
  3666.            .
  3667.            .
  3668.            .
  3669.            if ( ck_inkey() != 'A') {
  3670.               return(FALSE);
  3671.            } else {
  3672.               return(TRUE);
  3673.            }
  3674.            .
  3675.            .
  3676.            .
  3677.            ck_close_door();
  3678.          };
  3679.        };
  3680.  
  3681.  
  3682.                                                                  Functions
  3683.  
  3684.        ck_keystat                                low level
  3685.        -------------------------------------------------------------------
  3686.        Summary:       #include "ckit.h"
  3687.                       short ck_keystat(void);
  3688.  
  3689.        Description:   Check if character is available from local console.
  3690.                       Does not wait for input.
  3691.  
  3692.        Return Value:  Returns 0 if none available.  None-zero is available.
  3693.  
  3694.        See Also:      ck_input, ck_r_count, ck_key_source.
  3695.  
  3696.        Example:       This example checks for keypress at the keyboard
  3697.                       local console, returns TRUE or FALSE
  3698.  
  3699.        #include "ckit.h"
  3700.  
  3701.        main(int argc, char **argv) {
  3702.          if (argc > 1) {
  3703.            ck_open_door(argv[1]);
  3704.            .
  3705.            .
  3706.            .
  3707.            if ( ck_keystat() ) {
  3708.               return(FALSE);
  3709.            } else {
  3710.               return(TRUE);
  3711.            }
  3712.            .
  3713.            .
  3714.            .
  3715.            ck_close_door();
  3716.          };
  3717.        };
  3718.  
  3719.  
  3720.                                                                  Functions
  3721.  
  3722.        ck_r_count                                low level
  3723.        -------------------------------------------------------------------
  3724.        Summary:       #include "ckit.h"
  3725.                       short ck_r_count(void);
  3726.  
  3727.        Description:   Check if character is available from remote console.
  3728.                       Does not wait for input.
  3729.  
  3730.        Return Value:  Returns NULL if none available else returns number
  3731.                       of characters in the recieve queue.
  3732.  
  3733.        See Also:      ck_input, ck_r_count, ck_keystat.
  3734.  
  3735.        Example:       See ck_flush_rqueue below
  3736.  
  3737.  
  3738.  
  3739.                                                                  Functions
  3740.  
  3741.        ck_getkey                                 low level
  3742.        -------------------------------------------------------------------
  3743.        Summary:       #include "ckit.h"
  3744.                       size_t ck_getkey(void);
  3745.  
  3746.        Description:   Read character (if available)  from local console.
  3747.                       Does not wait for input.
  3748.  
  3749.        Return Value:  Returns FALSE if none available. Zero if true.
  3750.  
  3751.        See Also:      ck_input, ck_getkey, ck_keystat, ck_check_CTRL_K
  3752.  
  3753.        Example:       This example read key from local console buffer and
  3754.                       print to screen.
  3755.  
  3756.        #include "ckit.h"
  3757.  
  3758.        size_t ch;
  3759.  
  3760.        main(int argc, char **argv) {
  3761.          if (argc > 1) {
  3762.            ck_open_door(argv[1]);
  3763.            .
  3764.            .
  3765.            .
  3766.            ch = getkey();
  3767.            ck_s_putc(ch);
  3768.            .
  3769.            .
  3770.            .
  3771.            ck_close_door();
  3772.          };
  3773.        };
  3774.  
  3775.  
  3776.  
  3777.                                                                  Functions
  3778.  
  3779.        ck_sio_getbyte                            low level
  3780.        -------------------------------------------------------------------
  3781.        Summary:       #include "ckit.h"
  3782.                       BYTE ck_sio_getbyte(void);
  3783.  
  3784.        Description:   Read character (if available)  from remote console.
  3785.                       Does not wait for input.
  3786.  
  3787.        Return Value:  Returns NULL if none available else returns
  3788.                       character read.
  3789.  
  3790.        See Also:      ck_input, ck_sio_getbyte, ck_keystat, ck_check_CTRL_K
  3791.  
  3792.        Example:       This example reads byte from remote console buffer
  3793.                       and displays it, if one was available.
  3794.  
  3795.        #include "ckit.h"
  3796.  
  3797.        BYTE ch;
  3798.        main(int argc, char **argv) {
  3799.          if (argc > 1) {
  3800.            ck_open_door(argv[1]);
  3801.            .
  3802.            .
  3803.            .
  3804.            ch = ck_sio_getbyte();
  3805.            if(ch) {
  3806.                  ck_s_putc(ch);
  3807.            };
  3808.            .
  3809.            .
  3810.            .
  3811.            ck_close_door();
  3812.          };
  3813.        };
  3814.  
  3815.  
  3816.  
  3817.        ck_lower_dtr                              low level
  3818.        -------------------------------------------------------------------
  3819.        Summary:       #include "ckit.h"
  3820.                       void ck_lower_dtr(void);
  3821.  
  3822.        Description:   Drops DTR on com port, causing modem to hang up.
  3823.  
  3824.        Return Value:  NONE
  3825.  
  3826.        See Also:        ck_raise_dtr, ck_transmit_modem, ck_transmit_data
  3827.  
  3828.        Example:
  3829.                         see ck_transmit_modem below
  3830.  
  3831.                                                                  Functions
  3832.  
  3833.  
  3834.        ck_raise_dtr                              low level
  3835.        -------------------------------------------------------------------
  3836.        Summary:       #include "ckit.h"
  3837.                       void ck_raise_dtr(void);
  3838.  
  3839.        Description:   Raises DTR on com port, causing modem to hang up.
  3840.  
  3841.        Return Value:  NONE
  3842.  
  3843.        See Also:        ck_lower_dtr, ck_transmit_modem, ck_transmit_data
  3844.  
  3845.        Example:
  3846.                         see ck_transmit_modem below
  3847.  
  3848.  
  3849.                                                                  Functions
  3850.  
  3851.  
  3852.        ck_force_offhook                          low level
  3853.        -------------------------------------------------------------------
  3854.        Summary:       #include "ckit.h"
  3855.                       void ck_force_offhook(void);
  3856.  
  3857.        Description:   Drops DTR on com port, causing modem to hang up,
  3858.                       tells modem to go back offhook.
  3859.                       This function will wait 1 second after dropping
  3860.                       dtr and 2 seconds after raising DTR before
  3861.                       telling modem to go offhook.  This is normally
  3862.                       handled automatically by C-KIT depeding on the
  3863.                       ck_FORCEOFFHOOK setting.
  3864.  
  3865.        Return Value:  NONE
  3866.  
  3867.        See Also:     ck_FORCEOFFHOOK above.
  3868.  
  3869.        Example:      Send a string to reset the modem if carrier
  3870.                      is lost.
  3871.  
  3872.        #include "ckit.h"
  3873.  
  3874.        main(int argc, char **argv) {
  3875.          if (argc > 1) {
  3876.            ck_open_door(argv[1]);
  3877.            .
  3878.            .
  3879.            .
  3880.            ck_force_offhook(); /* Dump user offline */
  3881.            .
  3882.            .
  3883.            .
  3884.          };
  3885.          ck_close_door();
  3886.        };
  3887.  
  3888.  
  3889.                                                                  Functions
  3890.  
  3891.  
  3892.        ck_transmit_data                          low level
  3893.        -------------------------------------------------------------------
  3894.        Summary:       #include "ckit.h"
  3895.                       void ck_transmit_data(BYTE *);
  3896.  
  3897.        Description:   Send C string to remote console.
  3898.                       No echo to local console. Expects a pointer to either
  3899.                       a NULL terminate C string of type BYTE or char.
  3900.                       Check for carrier included.  To send a single byte
  3901.                       use the sample code below.
  3902.  
  3903.        Return Value:  NONE
  3904.  
  3905.        See Also: ck_transmit_modem
  3906.  
  3907.        Example:
  3908.  
  3909.        #include "ckit.h"
  3910.  
  3911.        #define BEEP 0x07
  3912.  
  3913.        static char remote_msg[] = "HELLO";
  3914.  
  3915.        main(int argc, char **argv) {
  3916.          if (argc > 1) {
  3917.            ck_open_door(argv[1]);
  3918.            .
  3919.            .
  3920.            .
  3921.            ck_transmit_data(remote_msg);
  3922.            send_byte(BELL);
  3923.            .
  3924.            .
  3925.            .
  3926.          };
  3927.         ck_close_door();
  3928.        };
  3929.  
  3930. /* To send a single byte to the remote only use this code: */
  3931.  
  3932.        void    send_byte(BYTE data) {
  3933.           BYTE byte_out[2];
  3934.           *byte_out = data;
  3935.           *(byte_out+1) = 0x00;         /* Make a 'C' string */
  3936.           transmit_data(byte_out);
  3937.        }
  3938.  
  3939.  
  3940.        ck_transmit_modem                         low level
  3941.        -------------------------------------------------------------------
  3942.        Summary:       #include "ckit.h"
  3943.                       short ck_transmit_modem(BYTE *);
  3944.  
  3945.        Description:   Send C string to modem/remote.
  3946.                       No echo to local console. Expects a pointer to either
  3947.                       a NULL terminate C string of type BYTE or char.
  3948.                       NO carrier checking is included.  If it returns
  3949.                       Non-Zero if error occured, otherwise it returns NULL.
  3950.  
  3951.        Return Value:  NONE
  3952.  
  3953.        See Also: ck_transmit_data
  3954.  
  3955.        Example:
  3956.  
  3957.        #include "ckit.h"
  3958.  
  3959.        static char dialnumber[] = "ATDT6159707418";
  3960.        #include "ckit.h"
  3961.        main(int argc, char **argv) {
  3962.          if (argc > 1) {
  3963.            ck_open_door(argv[1]);
  3964.            .
  3965.            .
  3966.            .
  3967.            ck_debug_on();
  3968.            ck_lower_dtr();    /* Drop user off */
  3969.            ck_raise_dtr();
  3970.            ck_wait(1);     /* wait for modem to reset */
  3971.            ck_flush_RQUEUE(); /* Flush receive queue   */
  3972.            ck_transmit_modem(dialnumber);
  3973.            ck_debug_off();
  3974.            while(ck_tqueue_len()); /* wait on modem */
  3975.            ck_get_cmdline();
  3976.            strcmp(ck_cmdline, "CARRIER");
  3977.            .
  3978.            .
  3979.            .
  3980.          };
  3981.          ck_close_door();
  3982.        };
  3983.  
  3984.                                                          Functions
  3985.  
  3986.        ck_tqueue_len                             low level
  3987.        -------------------------------------------------------------------
  3988.        Summary:       #include "ckit.h"
  3989.                       short ck_tqueue_len(void);
  3990.  
  3991.        Description:   Check number of bytes left in Transmit RQUEUE.
  3992.                       Normally this routine is not needed but is available
  3993.                       if needed.
  3994.  
  3995.  
  3996.        Return Value:  Bytes left in XMIT QUEUE
  3997.  
  3998.        See Also:      
  3999.  
  4000.        Example:
  4001.  
  4002.        #include "ckit.h"
  4003.  
  4004.        static char modem_msg[] = "ATX4";
  4005.        main(int argc, char **argv) {
  4006.          if (argc > 1) {
  4007.            ck_open_door(argv[1]);
  4008.            .
  4009.            .
  4010.            .
  4011.            ck_debug_on();
  4012.            ck_transmit_modem(message);
  4013.            while(ck_tqueue_len());
  4014.            ck_debug_off();
  4015.            .
  4016.            .
  4017.            .
  4018.          };
  4019.         ck_close_door();
  4020.        };
  4021.  
  4022.  
  4023.                                                                  Functions
  4024.  
  4025.        ck_flush_RQUEUE                           low level
  4026.        -------------------------------------------------------------------
  4027.        Summary:       #include "ckit.h"
  4028.                       void ck_flush_RQUEUE(void);
  4029.  
  4030.        Description:   Flush bytes from Receive QUEUE buffer.
  4031.  
  4032.        Return Value:  NONE
  4033.  
  4034.        See Also: r_count, tqueue_len
  4035.  
  4036.        Example:
  4037.  
  4038.        #include "ckit.h"
  4039.  
  4040.        static char message[] = "ATH1";
  4041.  
  4042.        main(int argc, char **argv) {
  4043.          if (argc > 1) {
  4044.            ck_open_door(argv[1]);
  4045.            .
  4046.            .
  4047.            .
  4048.           ck_flush_RQUEUE();         /* flush buffer */
  4049.           ck_transmit_modem(message);
  4050.           while (ck_r_count());      /* wait for response back */
  4051.            .
  4052.            .
  4053.            .
  4054.          };
  4055.         ck_close_door();
  4056.        };
  4057.  
  4058.  
  4059.                                                                  Functions
  4060.  
  4061.        ck_flush_TQUEUE                           low level
  4062.        -------------------------------------------------------------------
  4063.        Summary:       #include "ckit.h"
  4064.                       void ck_flush_TQUEUE(void);
  4065.  
  4066.        Description:   Flush bytes from Transmit QUEUE buffer.
  4067.  
  4068.        Return Value:  NONE
  4069.  
  4070.        See Also: tqueue_len
  4071.  
  4072.        Example:
  4073.  
  4074.        #include "ckit.h"
  4075.  
  4076.        static char message[] = "ATH1";
  4077.  
  4078.        main(int argc, char **argv) {
  4079.          if (argc > 1) {
  4080.            ck_open_door(argv[1]);
  4081.            .
  4082.            .
  4083.            .
  4084.           ck_flush_RQUEUE();         /* flush buffer */
  4085.           ck_transmit_modem(message);
  4086.           while (ck_r_count());      /* wait for response back */
  4087.            .
  4088.            .
  4089.           ck_flush_TQUEUE();         /* flush buffer */
  4090.            .
  4091.          };
  4092.         ck_close_door();
  4093.        };
  4094.  
  4095.  
  4096.                                                                  Functions
  4097.  
  4098.        ck_check_cd                               low level
  4099.        -------------------------------------------------------------------
  4100.        Summary:       #include "ckit.h"
  4101.                       BYTE ck_check_cd(void);
  4102.  
  4103.        Description:   Checks if carrier present. If present, returns
  4104.                       NON-zero.  Zero (NULL) means no carrier present.
  4105.  
  4106.        Return Value:  BYTE indicator of carrier present.
  4107.  
  4108.        See Also: ck_DUMP_USER, ck_transmit_data, ck_transmit_modem
  4109.  
  4110.  
  4111.                                                                  Functions
  4112.  
  4113.        ck_check_keypress                         low level
  4114.        -------------------------------------------------------------------
  4115.        Summary:       #include "ckit.h"
  4116.                       short ck_check_keypress(BYTE);
  4117.  
  4118.        Description:   Check for any specific ASCII character entered.
  4119.                       Does not wait for a character.
  4120.  
  4121.                         This function may or may not be useful
  4122.                         but is available if needed for a "hot_key"
  4123.                         function in a door.  Does no carrier checking!
  4124.  
  4125.        Return Value:  TRUE, FALSE
  4126.  
  4127.        See also: ck_check_CR, ck_input(), ck_getkey()
  4128.                  ck_wait_keypress, ck_check_CTRL_K
  4129.  
  4130.        Example:
  4131.  
  4132.        #include "ckit.h"
  4133.  
  4134.        BYTE result;
  4135.  
  4136.        main(int argc, char **argv) {
  4137.          if (argc > 1) {
  4138.            ck_open_door(argv[1]);
  4139.            .
  4140.            .
  4141.            .
  4142.            while {
  4143.              !(result = ck_check_keypress(0x41));
  4144.            };
  4145.            printf("Keypress returned %d", result);
  4146.            .
  4147.            .
  4148.            .
  4149.          };
  4150.         ck_close_door();
  4151.        };
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.   C-KIT based DOOR programs have many of the feature available for the
  4158. door author, and for the sysop using standard function keys such as:
  4159.  
  4160.              Function key
  4161.              ------------
  4162.                 F5              Shell to DOS
  4163.                 F8              Return user to system
  4164.                 F9              Toggle display on/off
  4165.                 F10             Chat mode  (use the ESCAPE key to exit)
  4166.               * F3              Toggle printer on/off
  4167.               * F4              Toggle pagebell on/off
  4168.               * F7              Toggle caller alarm on/off
  4169.  
  4170.              Alternate key
  4171.              -------------
  4172.                ALT-H            Toggle between different status lines
  4173.  
  4174.              * ALT-N            Toggle sysop on next
  4175.              * ALT-X            Toggle exit to dos after call
  4176.                                 and help lines
  4177.         Alternately pressing the ALT-H key will bring up
  4178.         the next status line screen.  The 1st screen is a help screen,
  4179.         the second second screen shows your COM port status.
  4180.  
  4181.  * The function keys marked with an "*"  will only be of use to systems
  4182.    using pcboard.sys.  The rest are functional with any system.
  4183.  
  4184.   Command stacking is also available and can be easily disabled if desired.
  4185. See the CKITDEMO.C for example of disabling command stacking.
  4186.                                   Files
  4187.                                  -------
  4188. C-KIT.DOC     -  This file.
  4189.  
  4190. CKITDEMO.EXE - This is a very short program written to test C-KIT libraries
  4191.                and for a short demo.  CKITDEMO.EXE is a compiled program
  4192.                using the C-KIT library.
  4193.  
  4194. CKIT.H     - This is a standard C header file, to be included with your
  4195.              door program.  This file contains all the function prototypes,
  4196.              and variable names and types available from C-KIT.
  4197.  
  4198. CKIT_MS.LIB - This file is the C-KIT library file to access all of the C-KIT
  4199. CKIT_MM.LIB  files that are linked into your door program for MSC.
  4200.  
  4201. CKIT_TS.LIB - This file is the C-KIT library file to access all of the C-KIT
  4202. CKIT_TM.LIB  files that are linked into your door program for TURBO C.
  4203.  
  4204. CKITDEMO.C - The source code for CKITDEMO demostrating a door written
  4205.               using C-KIT functions.
  4206.  
  4207. DEMO.BAT   - Sample .bat file to compile and link using the C-KIT.LIB
  4208.              Provided as an example.
  4209.  
  4210. CKIT_TC.ZIP - Contains TURBO C files
  4211.  
  4212. TCREAD.ME  - Information for TURBO C users
  4213.  
  4214. CKITDEMO.MAK -  TURBO C Make file for CKITDEMO door (for use as example)*
  4215.  
  4216. CKITS.PRJ    -  TURBO C Project file for CKITDEMO door (use as example)*
  4217.  
  4218. TCPPCKIT.PRJ -  TURBO C++ Project file for CKITDEMO door (use as example)*
  4219.  
  4220.      * For small models
  4221.  
  4222.  
  4223.    ATTENTION TURBO C USERS:  In versions 2.01 and below you should use
  4224.    WORD alignment, in C-kit 2.08 and above you should use BYTE alignment.
  4225.    This applies if you are planning to use the ck_users structure AND/OR
  4226.    the ck_update_user() function. The default on BORLAND is BYTE alignment.
  4227.    This will not work correctly for these two items.  If you are not
  4228.    using either the ck_users file structure or ck_update_user();
  4229.    function, then you don't have to use WORD alignment, BYTE alignment
  4230.    will work OK.
  4231.    See the file TCREAD.ME in the CKIT_TC.ZIP file.
  4232.    In addition, TURBO C++/BC++ users should also select standard stack
  4233.    frame alignment.
  4234.    Make a dir to work from. Copy the CKITDEMO.C, CKITDEMO.H, CKIT.H,
  4235.    the CKIT_T?.LIB's, and the TCPPCKIT.PRJ or CKITS.PRJ into the
  4236.    same dir.  Bring up the TURBO C IDE and select the proper project
  4237.    file and you can test the CKITDEMO.C.  Have it create an .exe file.
  4238.    This should get you started.   You can take it from here...
  4239.  
  4240.    This package can be freely distributed so long as it is not modified
  4241.    or sold for profit.  If you find that this program is valuable,  you 
  4242.    can  send me a donation for what you think it is worth.   I  suggest 
  4243.    at least $25.00 (USA exchange).   You will receive a program CKITREG.EXE.
  4244.    This  will register all future copies of C-KIT with your registration
  4245.    number. This means you would only have to download the new versions
  4246.    from your favorite board, saving you long distance charges!
  4247.    For registration over $25.00, full access to all Nodes on Data-Comp will
  4248.    be made available.  Source code modules are available to registered users
  4249.    for reading other system files that you may want to include in your
  4250.    door program. (as they become available).  There is now a complete
  4251.    set of PCBoard source code modules. (users.sys, pcboard.dat etc)
  4252.  
  4253.    Send your contributions to:
  4254.  
  4255.       Rickie W. Belitz
  4256.       P.O. Box 5895
  4257.       Maryville, TN 37802-5895
  4258.  
  4259.                                  SUPPORT
  4260.                                -----------
  4261.  
  4262.    If you have any questions, suggestions, or bug reports, contact me at:
  4263.  
  4264.        Data-Comp BBS
  4265.        (615) 982-8723  (Hayes Ultra V.32)             (public  line)
  4266.        (615) 982-6537  (Hayes Ultra V.32)             (private line)
  4267.        (615) 982-6512  (USR HST Dual Standard V.32),  (private line)
  4268.        (615) 970-7418  (USR HST Dual Standard V.32),  (private line)
  4269.  
  4270.         NOTE: The board has automatic rollover on the phone lines.
  4271.         There is chance you could end up on one of the private lines
  4272.         with limited time.
  4273.  
  4274.    I can also be reached via mail networks thru INTELEC's BBS_DOORS conference
  4275.    and RIME's (Relaynet) DOORS conference.
  4276.  
  4277.  
  4278.                                ACKNOWLEDGEMENTS
  4279.                              --------------------
  4280.         I would like to give special thanks to my Co-sysop, Dean McGuire,
  4281.         who has patiently tested the door routines and for help preparing the
  4282.         documentation.
  4283.  
  4284.                                   GENERIC.SYS
  4285.                           --------------------------
  4286.    For maximum compatibility, C-KIT will also read a file called
  4287. GENERIC.SYS.  This file can be created by the sysop desiring to run
  4288. the door and allow C-KIT to operate.  This would allow your door to
  4289. operate on ANY BBS system.  (see compatibilty issues below).  The
  4290. GENERIC.SYS file is a standard ASCII file and contains 3 lines, each
  4291. followed by a carriage return, line feed.  The format is:
  4292.  
  4293.         line 1  -  The BBS operator's name.
  4294.         line 2  -  The COM port in use.
  4295.         line 3  -  Time allowed in door.
  4296.  
  4297.   When C-KIT finds a GENERIC.SYS, it will ask the user for his/her first and
  4298. last names before opening the door.  After the user inputs their name,
  4299. the door will continue to load and run.  Below is an example GENERIC.SYS
  4300. file with a sysop name of Rickie, using Com port 1, and allowing 50 minutes
  4301. in the door.
  4302.  
  4303. Rickie
  4304. COM1:
  4305. 50
  4306.  
  4307.   Each line is followed by a C/R, L/F and the com port follows the same
  4308. format as the standard door.sys.  COM0: = Local Mode (same as door.sys)
  4309. See the compatibilty issues below for more information.
  4310.  
  4311. NOTE: You should include this information in your door documentation also.
  4312.  
  4313.  
  4314.  
  4315.                              COMPATIBILITY ISSUES
  4316.                           --------------------------
  4317.    Although C-KIT makes a lot information available to the user, the author
  4318.  has to decide on what particular information his or her door will require.
  4319.  Here are some general guidelines that may help.  Decide on exactly what
  4320.  information your door will need to operate.  Keeping this to a minimum
  4321.  increases your chances of maintaining compatibility thruout the different
  4322.  BBS's systems and versions thereof which C-KIT supports.
  4323.  
  4324.    For example, let's assume you are designing a standard BBS game.  C-KIT
  4325.  handles all the detailed information such as time left, carrier detect etc.
  4326.  All you would really need is some basic information.  Perhaps just the
  4327.  user's name and sysop name.   By keeping this type of information to the
  4328.  minimum, your door would work regardless of whether the sysop running your
  4329.  door used pcboard.sys, door.sys, callinfo.bbs or GENERIC.SYS on the command
  4330.  line..i.e,  game.exe c:\pcb\pcboard.sys OR game.exe c:\pcb\door.sys OR
  4331.  game.exe c:\wc\callinfo.bbs, OR game.exe c:\GENERIC.SYS OR
  4332.  game.exe c:\rbbs\DORINFOx.DEF;,  ANY  of these would work.  (If the sysop
  4333.  was running PCBoard 12.0, he would only be able to use pcboard.sys.
  4334.  In this case, C-KIT would not only take care of deciding if it was a
  4335.  pcboard.sys file, door.sys file, WILDCAT! callinfo.bbs or DORINFOx.DEF, but
  4336.  also if it *is* a pcboard.sys file, whether it is a PCBoard 12.0 sys file
  4337.  or later, and then would read it properly!).   This would make your door
  4338.  compatible with the full spectrum of PCBoard 12.0-14.5, WILDCAT!, GAP,
  4339.  SPITFIRE 3.0, other systems using the standard door.sys file, RBBS and
  4340.  others using DORINFO1.DEF and ANY BBS using GENERIC.SYS with minimum effort
  4341.  on the part of the sysop running your door.  Once you've written this
  4342.  fantastic new door, if it's a snap for a Sysop to install it, this might
  4343.  make him a bit more inclined to register it, right?
  4344.  
  4345.    Another senario would be if your door needs somewhat more than the basic
  4346.  information.  I would recommend using the variables available in door.sys
  4347.  and WILDCAT! info file in this case.  This would give you the broadest
  4348.  coverage for your door. If you will notice in the variables descriptions
  4349.  in this manual, there is a compatibility list to the right of each variable.
  4350.  This tells you which and what type of information is available to you
  4351.  depending on whether your door found a door.sys, pcboard.sys (and which
  4352.  version of PCBoard), WILDCAT! info file and DORINFOx.DEF file.  Below
  4353.  is a summary and quick guide to each pcboard.sys version, door.sys,
  4354.  WILDCAT!, DORINFOx.DEF info file and which information variables are
  4355.  available with each.
  4356.  
  4357.    If you need EVEN more information, then you can tell C-KIT to open the
  4358.  users file and read information.  Doing so will limit your door to PCBoard
  4359.  systems only.  C-KIT will NOT record any information to the user's file
  4360.  unless a call to update_user has been made.  It will also not record anything
  4361.  to sysop record.
  4362.  
  4363.                   Compatible with...
  4364.                   ----------------------------------------------------------
  4365.     "ck_"         PCBoard.sys
  4366.    Variables      12.0  14.0-14.5  DOOR.SYS  WILDCAT! DORINFOx.DEF GENERIC.SYS
  4367.  --------------   ----  --------   --------  -------  -----------  -----------
  4368.  *conferences                          X         X
  4369.  aport              X     X            X         X      X             X
  4370.  ansi_ng                               X
  4371.  BBSname                                                X
  4372.  bps_open                 X            X         X
  4373.  baud_rate          X     X            X         X      X
  4374.  callalarm          X     X            X
  4375.  current_conf       X     X            X
  4376.  caller_bday                           X         X
  4377.  display            X     X            X         X      X
  4378.  default_color                         X
  4379.  daily_bytes                           X         X
  4380.  daily_files                           X         X
  4381.  download_Kbytes                       X         X
  4382.  door_opened                                     X
  4383.  DOTS               X     X            X         X      X             X
  4384.  dload_total              X            X         X
  4385.  error_connection   X     X            X         X
  4386.  expert             X     X            X         X
  4387.  event_active             X
  4388.  event_slide              X
  4389.  event_time               X            X         X
  4390.  firstname          X     X            X         X      X             X
  4391.  fullname           X     X            X         X      X             X
  4392.  graphics           X     X            X         X      X
  4393.  gen_dir                               X
  4394.  high_msg                                        X
  4395.  key_source         X     X            X         X      X
  4396.  local              X     X            X         X      X
  4397.  logoff_color       X     X            X         X
  4398.  exit_msg           X     X            X         X      X
  4399.  language           X     X
  4400.  last_file_scan     X     X            X         X
  4401.  min_left           X     X            X         X      X             X
  4402.  main_dir                              X
  4403.  max_files                             X
  4404.  max_sec                                         X
  4405.  monitor_type                                    X
  4406.  msgs_left                             X
  4407.  name_in_use                                     X
  4408.  netchat            X     X
  4409.  node                     X            X         X      X
  4410.  NO_FKEYS           X     X            X         X      X             X
  4411.  NOSYSTEM           X     X            X         X      X             X
  4412.  printer            X     X            X
  4413.  protocol           X     X            X         X
  4414.  pagebell           X     X            X
  4415.  password           X     X            X         X
  4416.  page_length        X     X            X         X      X
  4417.  PCB                X     X            X         X      X
  4418.  PCB12              X     X            X         X      X
  4419.  prev_used                X
  4420.  port               X     X            X         X      X
  4421.  parity                                X         X
  4422.  RBBS               X     X            X         X      X             X
  4423.  record_lock                           X
  4424.  scan_code          X     X            X         X      X
  4425.  security_level                        X         X      X
  4426.  silent             X     X            X         X      X             X
  4427.  sysop_next         X     X
  4428.  sysop_name                            X                X             X
  4429.  sysop_alias                           X
  4430.  time_logged        X     X            X         X      X
  4431.  time_on            X     X
  4432.  time_limit         X     X
  4433.  time_added         X     X
  4434.  total_doors                           X
  4435.  user_record        X     X            X         X
  4436.  upload_Kbytes                         X
  4437.  upload_total             X            X         X
  4438.  ck_usercomment1                       X
  4439.  WILDCAT            X     X            X         X      X
  4440.  
  4441.  One last note - There are four variables PCB12, PCB, WILDCAT and GAP.  When
  4442.  C-KIT reads a pcboard.sys file, it will set the PCB variable TRUE.  If the
  4443.  pcboard.sys file it read was a 12.0 file, it will set the PCB12 variable true.
  4444.  If C-KIT finds a WILDCAT system, it will set the variable WILDCAT true.  This
  4445.  may be useful in making adjustments to your program depending on which system
  4446.  file was read (PCB, DOOR.SYS, PCB12, WILDCAT)  and/or if a sysop was running
  4447.  PCBoard 12.0 and you normally expected door.sys or wildcat info file.
  4448.  If C-KIT finds a door.sys file, GAP will be set true.
  4449.  
  4450.  Also, see the users file information earlier in the doc file.  Some of the
  4451.  users structure information is available even if you are just using door.sys.
  4452.  If you do tell C-KIT to open the users file, all the users file information
  4453.  above will be available, if C-KIT finds a version 14.x pcboard.sys.  If it
  4454.  finds a PCBoard 12.0 pcboard.sys file, some, but not all, of the users
  4455.  structure information will be available.  Each member of the users structure
  4456.  is marked to indicate what is available and what is not depending on the
  4457.  things just mentioned.
  4458.  
  4459.  
  4460.                                                                   Warranty
  4461.  
  4462.                                   Warranty
  4463.                                 ------------
  4464.        I make no warranty of any kind, express or implied, including
  4465.        without limitation, any warranties of merchantability and/or
  4466.        fitness for a particular purpose.  I shall not be held liable for
  4467.        any  damages, whether direct, indirect, special or consequential
  4468.        arising from a failure  of this program to operate in the manner
  4469.        desired by the user.  I shall not be held liable for any damage to
  4470.        data or property which may be caused directly or indirectly by the
  4471.        use of this program.
  4472.  
  4473.        In no event will I be held liable for any damages, including (but
  4474.        not limited to) any lost profits, lost savings or other incidental
  4475.        or consequential damages arising out of the use or inability to
  4476.        use this program, or for any claim by any other party.
  4477.  
  4478.        This warranty is governed by the laws of the State of Tennessee.
  4479.  
  4480.  
  4481.                                  ORDER.FRM       v2.1
  4482.                                -------------
  4483.  
  4484.                                    Return to:     Rickie Belitz
  4485.                                                   P.O. Box 5895
  4486.                                                   Maryville, TN 37802-5895
  4487.  
  4488.   Name ______________________________________________________________
  4489.  
  4490.   Company ___________________________________________________________
  4491.  
  4492.   Address ___________________________________________________________
  4493.  
  4494.           ___________________________________________________________
  4495.  
  4496.   Phone _____________________________________________________________
  4497.  
  4498.   Register C-KIT to:  Name____________________________________________
  4499.  
  4500.   Diskette size:  ____ 5.25" acceptable       ____ 3.5" required*
  4501.  
  4502.   Orders outside the USA add $4.00                         _________
  4503.  
  4504.   *Add $4.00 for 3.5" diskettes 720K ___ 1.44 ___          _________
  4505.  
  4506.       Please find enclosed a check or money order for USA $_________
  4507.   ($25.00 suggested) payable to Rickie Belitz.  This shows my support
  4508.   of Shareware products and the Shareware concept.  It also shows my
  4509.   encouragement to help further development of C-KIT.
  4510.  
  4511.       I understand that C-KIT is provided as-is and no warranties of
  4512.   any kind, expressed or otherwise, are included and that I am using
  4513.   it at my own risk.
  4514.  
  4515.   Signed: _________________________________________  Date: _________
  4516.  
  4517.  
  4518.  
  4519.                                  RELEASE HISTORY
  4520.                                -------------------
  4521.                                 see history file
  4522.  
  4523.  
  4524.                           SOME COMMON PROBLEMS/QUESTIONS
  4525.                           ------------------------------
  4526. Q. How can a test my door in "local" mode?
  4527.  
  4528. A. There is a door.sys file included with the C-KIT libraries.
  4529.    The first line in the door.sys file is COM0:.  With accordance
  4530.    to doorsys specs., this specifies "local" mode.  Use this file
  4531.    for testing your doors.  You can modify the door.sys
  4532.    file to also use a com port for online testing.  See the
  4533.    doorsys.txt for more information.  You could also make up a
  4534.    GENERIC.SYS file and use COM0: as the port.  See the section
  4535.    on GENERIC.SYS.
  4536.  
  4537. Q. When linking my code with the library I get a linker error -
  4538.    Unresolved external _progname in CKIT3.ASM.
  4539.  
  4540. A. C-KIT will look for a C string array called progname[21];.  This the
  4541.    name of your door program and will appear at the bottom of the local
  4542.    line.  This is not an option.  You must declare some kind of name
  4543.    for C-KIT to use even if it just a space char if you don't want your
  4544.    progname at the bottom.  See the CKIDEMO.H file for example and
  4545.    the variable progname[] in the doc file.
  4546.  
  4547. Q. When linking your ckitdemo program, I get an error -
  4548.    Unresolved external _random in ckitdemo.c
  4549.  
  4550. A. The Ckitdemo.c door was written to be compiled with either Microsoft C
  4551.    or Turbo C.  As such, there are compiler directives in the CKITDEMO.C
  4552.    file that will take appropriate action depending on the compiler.
  4553.    Therefore, when compiling the CKITDEMO.C program, you must have the
  4554.    statement -DCOMPILER=MICROSOFT or -DCOMPILER=TURBOC on the command
  4555.    line.   This is needed only when compiling the CKITDEMO.C program.
  4556.    It is NOT needed when you are compiling your own door program.
  4557.  
  4558. Q. Do I have to include the -DCOMPILER-MICROSOFT or -DCOMPILER=TURBOC
  4559.    on the command line every time I compile my door program?
  4560.  
  4561. A. No, this was only needed for the CKITDEMO.C source code.  You can
  4562.    also modify the ckitdemo.c and ckitdemo.h file and take the compiler
  4563.    directives out if you like.  Then you would not have to use it when
  4564.    compiling the ckitdemo.c.  (Just make sure you take the right ones
  4565.    out for whichever compiler you are using). Matter fact, the way
  4566.    the defaults are defined in CKITDEMO.C, and CKITDEMO.H you don't
  4567.    need to have the -DCOMPILER=TURBOC when using TURBO C to compile
  4568.    the ckitdemo.c file or using Turbo C's IDE.
  4569.  
  4570. Q. My F4, F3, F7, ALT X, ALT N keys do not do have any effect when
  4571.    returning to the BBS.
  4572.  
  4573. A. These keys are valid only on doors or sysops using the pcboard.sys
  4574.    file.  When the code finds a door.sys or Wildcat! info files, it
  4575.    will make no attempt to update a pcboard.sys file.
  4576.    F5 shell to DOS, F8 return to BBS, F9 screen on/off will work
  4577.    with any system.  Try and write your door so that the sysop
  4578.    can use pcboard.sys if he is a PCBoard sysop but will also run
  4579.    on other systems as well.  Future updates will take into consideration
  4580.    other systems as permitted.  See the compatibility chart above.
  4581.  
  4582. Q. Why all the formfeeds in the documentation?
  4583.  
  4584. A. This is so that people with access to a copier can print them out,
  4585.    run the printed sheets thru the copier and duplex (print on both
  4586.    sides) the sheets into a manual.  If you do not want the form
  4587.    feeds, just do a global replacement with your favorite editor
  4588.    and get rid of them.
  4589.  
  4590. Q. I thought C-KIT required that the users file path be listed also?
  4591.  
  4592. A. NO.  This was used for the CKITDEMO file only. C-KIT
  4593.         library does not care one way or another about the users
  4594.         file being open.  CKITDEMO is also written to work with ANY
  4595.         system.  Ckitdemo is a demostration of how a door can be
  4596.         written to accept any command line given and make adjustments
  4597.         accordingly.  Ckitdemo will accept either:
  4598.         ckitdemo.exe c:\pcb\pcboard.sys c:\pcb\main\users
  4599.         ckitdemo.exe c:\pcb\door.sys
  4600.         ckitdemo.exe c:\wc\callinfo.bbs PORT:03e8:5
  4601.         See the open_door() function for more information.
  4602.  
  4603.  
  4604. Q. Will C-KIT work with any systems users file?
  4605.  
  4606. A. NO.  If you require information from the user file it must be
  4607.         be PCBoard 14.x or PCBoard 12.0.  However, by doing so
  4608.         you will be limiting your door to the number of systems
  4609.         it can be ran on.  I would not recommend using user file
  4610.         info unless your door is being written specifically for
  4611.         PCBoard.  Other system files (pcboard.dat, msgs and
  4612.         other systems users file) will be included in the form of
  4613.         source code at a later date.  This will allow you to
  4614.         link those with the existing C-KIT library functions.
  4615.  
  4616. Q. What baud rates can C-KIT can handle?
  4617.  
  4618. A.     C-KIT can handle ANY baud rate from 50 baud to 230K baud.
  4619.        (these are the baud rates it has been used with).  The highest
  4620.        baud any standard IBM compt. system can produce is 115K
  4621.        baud.  The 230K baud was done on a modified IBM AT by changing
  4622.        the UART's xtal and using 16550A UARTs.
  4623.  
  4624. Q. I'm using MSC 6.0 and when I compile my program I get a message
  4625.    "warning 'NULL' : macro redefinition"?
  4626.  
  4627. A. This is not a problem.  It is actually a carry over from MSC5.1.
  4628.    If you wish, you can remove the line #define NULL = 0 in the CKIT.H
  4629.    header file. MSC 6.0 redefined their NULL assignment in the stdlib.h
  4630.    file which causes this.  You will not get the warning with MSC 5.1
  4631.    or lower and TURBO C.
  4632.  
  4633. Q. I'm using TURBOC and when I compile the small model demo program
  4634.    it works fine.  But when I re-compile using medium model I get
  4635.    stack overflow fixup errors from the linker.
  4636.  
  4637. A. TurboC does not delete and re-compile the CKITDEMO.C module.
  4638.    So when it attempts to link the older small model .obj file you created
  4639.    earlier with the medium library, you will get this error.  When
  4640.    you switch memory models, you must delete the previous .obj file
  4641.    created using the small memory model.  If this happened to be
  4642.    CKITDEMO.C, you would need to delete CKITDEMO.OBJ before changing
  4643.    memory models.
  4644.  
  4645. Q. Some function keys are not trapped locally.
  4646.  
  4647. A. Some keys are reserved on the local keyboard for sysop functions.
  4648.    Try to design your door without using the F3, F4, F5, F7, F8, F9
  4649.    ALT-H, ALT-N, ALT-X.   If you have to use these keys, they can
  4650.    be used by the remote keyboard but just be aware, you would not
  4651.    be able to use them on your local keyboard.
  4652.  
  4653. Q. When linking my program, I get an error -
  4654.    Unresolved external _wait.
  4655.  
  4656. A. This function was renamed to ck_wait in v1.7.  You need to
  4657.    be using the CKIT.h header file.  There was a conflict with
  4658.    one of Borland's library names.
  4659.  
  4660. Q. Why does the user security level somtimes show on the status line
  4661.    and sometimes it doesn't?
  4662.  
  4663. A. PCBoard.sys file does not provide that information.  The security
  4664.    level will only show if you are using door.sys, callinfo.bbs  (WILDCAT!)
  4665.    or you are using pcboard.sys and open the users file.
  4666.    The status line indicators for pagebell, printer and caller alarm
  4667.    will also not show up if you are using door.sys or callinfo.bbs
  4668.    but will if you are using any version of pcboard.sys from 12.0 up.
  4669.  
  4670. Q. Will there be any kind of sign off message from C-KIT after the program
  4671.    is registered?
  4672.  
  4673. A. After C-KIT is registered, the only message displayed when closing the
  4674.    door will be the one you defined using the *ck_logoff_msgs or the
  4675.    default   "Returning to system ...".
  4676.